feat: TypeScript typings for Dispatcher implementations

A first pass at specifying some implementations in TypeScript
  that actually compiles. It doesn't do anything, as installing
  types and operation specifications are currently dummy operations,
  but they are all invoked.
This commit is contained in:
Glen Whitney 2022-12-06 20:21:05 -05:00
parent 2a9039ac67
commit ccc6153786
14 changed files with 100 additions and 123 deletions

13
src/numbers/type.ts Normal file
View file

@ -0,0 +1,13 @@
export const number_type = {
before: ['Complex'],
test: (n: unknown): n is number => typeof n === 'number',
from: {string: s => +s}
}
export const zero = (a: number) => 0
declare module "../core/Dispatcher" {
interface ImplementationTypes {
zero_numbers: typeof zero
}
}