diff --git a/AliceJS.d.ts b/AliceJS.d.ts index 2652b9d..ce5b1bd 100644 --- a/AliceJS.d.ts +++ b/AliceJS.d.ts @@ -8,17 +8,17 @@ declare function h( ...children: (HTMLElement | string)[] ): Node; -type AliceJSReferenceSink = { readonly __symbol: unique symbol, readonly __signature: T }; +type DLPointer = { readonly __symbol: unique symbol, readonly __signature: T }; -declare function use(sink: T | any, mapping?: (...args: any[]) => any): AliceJSReferenceSink; -declare function useValue(sink: AliceJSReferenceSink): T; +declare function use(sink: T, mapping?: (arg: T) => any): DLPointer; +declare function useValue(trap: DLPointer): T; type Stateful = T & { readonly symbol: unique symbol }; declare function stateful(target: T): Stateful; -declare function handle(references: AliceJSReferenceSink, callback: (value: T) => void): void; +declare function handle(references: DLPointer, callback: (value: T) => void): void; declare function css(strings: TemplateStringsArray, ...values: any): string; declare function rule(strings: TemplateStringsArray, ...values: any): string; @@ -30,6 +30,12 @@ interface Element { $: DLComponent } +interface DLElement extends Element { + $: T +} + +declare var $el: HTMLElement; + type DLComponent = { css: DLCSS, root: Element, diff --git a/css.js b/css.js index d89e16b..e1bb3b4 100644 --- a/css.js +++ b/css.js @@ -37,7 +37,7 @@ function tagcss(strings, values, isblock) { if (values[i]) { const prop = values[i]; - if (isAJSReferences(prop)) { + if (isDLPtr(prop)) { const current_i = flattened_template.length; let oldparsed; handle(prop, (val) => {