|
|
@ -10,37 +10,51 @@ export type EventCallbackMap = Record<string, EventCallback | EventCallback[]>;
|
|
|
|
// when the JS VM JITs the code.
|
|
|
|
// when the JS VM JITs the code.
|
|
|
|
|
|
|
|
|
|
|
|
export type ComponentContext = {
|
|
|
|
export type ComponentContext = {
|
|
|
|
/** local signals (needed for beforeUpdate/afterUpdate) */
|
|
|
|
|
|
|
|
d: null | Source[];
|
|
|
|
|
|
|
|
/** props */
|
|
|
|
|
|
|
|
s: Record<string, unknown>;
|
|
|
|
|
|
|
|
/** exports (and props, if `accessors: true`) */
|
|
|
|
|
|
|
|
x: Record<string, any> | null;
|
|
|
|
|
|
|
|
/** deferred effects */
|
|
|
|
|
|
|
|
e: null | Array<() => void | (() => void)>;
|
|
|
|
|
|
|
|
/** mounted */
|
|
|
|
|
|
|
|
m: boolean;
|
|
|
|
|
|
|
|
/** parent */
|
|
|
|
/** parent */
|
|
|
|
p: null | ComponentContext;
|
|
|
|
p: null | ComponentContext;
|
|
|
|
/** context */
|
|
|
|
/** context */
|
|
|
|
c: null | Map<unknown, unknown>;
|
|
|
|
c: null | Map<unknown, unknown>;
|
|
|
|
/** runes */
|
|
|
|
/** deferred effects */
|
|
|
|
r: boolean;
|
|
|
|
e: null | Array<() => void | (() => void)>;
|
|
|
|
/** legacy mode: if `$:` statements are allowed to run (ensures they only run once per render) */
|
|
|
|
/** mounted */
|
|
|
|
l1: any[];
|
|
|
|
m: boolean;
|
|
|
|
/** legacy mode: if `$:` statements are allowed to run (ensures they only run once per render) */
|
|
|
|
/**
|
|
|
|
l2: Source<boolean>;
|
|
|
|
* props — needed for legacy mode lifecycle functions, and for `createEventDispatcher`
|
|
|
|
/** update_callbacks */
|
|
|
|
* @deprecated remove in 6.0
|
|
|
|
u: null | {
|
|
|
|
*/
|
|
|
|
/** afterUpdate callbacks */
|
|
|
|
s: Record<string, unknown>;
|
|
|
|
a: Array<() => void>;
|
|
|
|
/**
|
|
|
|
/** beforeUpdate callbacks */
|
|
|
|
* exports (and props, if `accessors: true`) — needed for `createEventDispatcher`
|
|
|
|
b: Array<() => void>;
|
|
|
|
* @deprecated remove in 6.0
|
|
|
|
/** onMount callbacks */
|
|
|
|
*/
|
|
|
|
m: Array<() => any>;
|
|
|
|
x: Record<string, any> | null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* legacy stuff
|
|
|
|
|
|
|
|
* @deprecated remove in 6.0
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
l: null | {
|
|
|
|
|
|
|
|
/** local signals (needed for beforeUpdate/afterUpdate) */
|
|
|
|
|
|
|
|
s: null | Source[];
|
|
|
|
|
|
|
|
/** update_callbacks */
|
|
|
|
|
|
|
|
u: null | {
|
|
|
|
|
|
|
|
/** afterUpdate callbacks */
|
|
|
|
|
|
|
|
a: Array<() => void>;
|
|
|
|
|
|
|
|
/** beforeUpdate callbacks */
|
|
|
|
|
|
|
|
b: Array<() => void>;
|
|
|
|
|
|
|
|
/** onMount callbacks */
|
|
|
|
|
|
|
|
m: Array<() => any>;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/** `$:` statements */
|
|
|
|
|
|
|
|
r1: any[];
|
|
|
|
|
|
|
|
/** This tracks whether `$:` statements have run in the current cycle, to ensure they only run once */
|
|
|
|
|
|
|
|
r2: Source<boolean>;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export type ComponentContextLegacy = ComponentContext & {
|
|
|
|
|
|
|
|
l: NonNullable<ComponentContext['l']>;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export type Equals = (this: Value, value: unknown) => boolean;
|
|
|
|
export type Equals = (this: Value, value: unknown) => boolean;
|
|
|
|
|
|
|
|
|
|
|
|
export type TemplateNode = Text | Element | Comment;
|
|
|
|
export type TemplateNode = Text | Element | Comment;
|
|
|
|