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:
parent
2a9039ac67
commit
ccc6153786
14 changed files with 100 additions and 123 deletions
13
src/numbers/type.ts
Normal file
13
src/numbers/type.ts
Normal 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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue