mirror of
https://github.com/MercuryWorkshop/dreamlandjs.git
synced 2025-05-16 15:40:01 -04:00
fix css and types
This commit is contained in:
parent
2d577a6a99
commit
f286085c3a
2 changed files with 11 additions and 5 deletions
14
AliceJS.d.ts
vendored
14
AliceJS.d.ts
vendored
|
@ -8,17 +8,17 @@ declare function h(
|
|||
...children: (HTMLElement | string)[]
|
||||
): Node;
|
||||
|
||||
type AliceJSReferenceSink<T> = { readonly __symbol: unique symbol, readonly __signature: T };
|
||||
type DLPointer<T> = { readonly __symbol: unique symbol, readonly __signature: T };
|
||||
|
||||
declare function use<T>(sink: T | any, mapping?: (...args: any[]) => any): AliceJSReferenceSink<T>;
|
||||
declare function useValue<T>(sink: AliceJSReferenceSink<T>): T;
|
||||
declare function use<T>(sink: T, mapping?: (arg: T) => any): DLPointer<T>;
|
||||
declare function useValue<T>(trap: DLPointer<T>): T;
|
||||
|
||||
type Stateful<T> = T & { readonly symbol: unique symbol };
|
||||
|
||||
|
||||
declare function stateful<T>(target: T): Stateful<T>;
|
||||
|
||||
declare function handle<T>(references: AliceJSReferenceSink<T>, callback: (value: T) => void): void;
|
||||
declare function handle<T>(references: DLPointer<T>, 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<any>
|
||||
}
|
||||
|
||||
interface DLElement<T> extends Element {
|
||||
$: T
|
||||
}
|
||||
|
||||
declare var $el: HTMLElement;
|
||||
|
||||
type DLComponent<T> = {
|
||||
css: DLCSS,
|
||||
root: Element,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue