-
Notifications
You must be signed in to change notification settings - Fork 0
/
scalar.d.ts
27 lines (22 loc) · 923 Bytes
/
scalar.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
declare module 'scalar' {
const scalar: {
Component: Class<Component>,
Module: Class<Module>,
customElement: function ({template?: string, styles?: string, type?: string}): ClassDecorator
};
export = scalar
}
declare class Component {
inject<T> (provider: Class<T>): T
compose<T extends Component> ($domElement: HTMLElement, behavioral: Class<T>|BehavioralFunction): T
getIndex (e: Event): string|undenined
}
declare class Module {
compose<T extends Component> (selector: string, component: Class<T>|BehavioralFunction): Module
bind<T, R> (origin: Class<T>, replace: Class<R>): Module
add(module: Module): Module
execute(): void
}
declare type BehavioralFunction = (compound: Component) => Payload
declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
declare type Class<T> = { new (...args: Array<any>): T }