@@ -10,37 +10,51 @@ export type EventCallbackMap = Record<string, EventCallback | EventCallback[]>;
1010// when the JS VM JITs the code.
1111
1212export type ComponentContext = {
13- /** local signals (needed for beforeUpdate/afterUpdate) */
14- d : null | Source [ ] ;
15- /** props */
16- s : Record < string , unknown > ;
17- /** exports (and props, if `accessors: true`) */
18- x : Record < string , any > | null ;
19- /** deferred effects */
20- e : null | Array < ( ) => void | ( ( ) => void ) > ;
21- /** mounted */
22- m : boolean ;
2313 /** parent */
2414 p : null | ComponentContext ;
2515 /** context */
2616 c : null | Map < unknown , unknown > ;
27- /** runes */
28- r : boolean ;
29- /** legacy mode: if `$:` statements are allowed to run (ensures they only run once per render) */
30- l1 : any [ ] ;
31- /** legacy mode: if `$:` statements are allowed to run (ensures they only run once per render) */
32- l2 : Source < boolean > ;
33- /** update_callbacks */
34- u : null | {
35- /** afterUpdate callbacks */
36- a : Array < ( ) => void > ;
37- /** beforeUpdate callbacks */
38- b : Array < ( ) => void > ;
39- /** onMount callbacks */
40- m : Array < ( ) => any > ;
17+ /** deferred effects */
18+ e : null | Array < ( ) => void | ( ( ) => void ) > ;
19+ /** mounted */
20+ m : boolean ;
21+ /**
22+ * props — needed for legacy mode lifecycle functions, and for `createEventDispatcher`
23+ * @deprecated remove in 6.0
24+ */
25+ s : Record < string , unknown > ;
26+ /**
27+ * exports (and props, if `accessors: true`) — needed for `createEventDispatcher`
28+ * @deprecated remove in 6.0
29+ */
30+ x : Record < string , any > | null ;
31+ /**
32+ * legacy stuff
33+ * @deprecated remove in 6.0
34+ */
35+ l : null | {
36+ /** local signals (needed for beforeUpdate/afterUpdate) */
37+ s : null | Source [ ] ;
38+ /** update_callbacks */
39+ u : null | {
40+ /** afterUpdate callbacks */
41+ a : Array < ( ) => void > ;
42+ /** beforeUpdate callbacks */
43+ b : Array < ( ) => void > ;
44+ /** onMount callbacks */
45+ m : Array < ( ) => any > ;
46+ } ;
47+ /** `$:` statements */
48+ r1 : any [ ] ;
49+ /** This tracks whether `$:` statements have run in the current cycle, to ensure they only run once */
50+ r2 : Source < boolean > ;
4151 } ;
4252} ;
4353
54+ export type ComponentContextLegacy = ComponentContext & {
55+ l : NonNullable < ComponentContext [ 'l' ] > ;
56+ } ;
57+
4458export type Equals = ( this : Value , value : unknown ) => boolean ;
4559
4660export type TemplateNode = Text | Element | Comment ;
0 commit comments