From 75999693aa33d9311de2678d376ec539c55bf728 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Sat, 18 Nov 2023 19:44:39 +0000 Subject: [PATCH] jsdoc --- .../svelte/src/internal/client/types.d.ts | 169 +++++++++--------- 1 file changed, 86 insertions(+), 83 deletions(-) diff --git a/packages/svelte/src/internal/client/types.d.ts b/packages/svelte/src/internal/client/types.d.ts index 357c8e5ec9..a87b08907f 100644 --- a/packages/svelte/src/internal/client/types.d.ts +++ b/packages/svelte/src/internal/client/types.d.ts @@ -35,26 +35,29 @@ export type Store = { // when the JS VM JITs the code. export type ComponentContext = { - // props + /** props */ s: MaybeSignal>; - // accessors + /** accessors */ a: Record | null; - // effects + /** effectgs */ e: null | Array; - // mounted + /** mounted */ m: boolean; - // parent + /** parent */ p: null | ComponentContext; - // context + /** context */ c: null | Map; - // immutable + /** immutable */ i: boolean; - // runes + /** runes */ r: boolean; - // update_callbacks + /** update_callbacks */ u: null | { + /** before */ b: Array<() => void>; + /** after */ a: Array<() => void>; + /** execute */ e: () => void; }; }; @@ -125,176 +128,176 @@ export type BlockType = export type TemplateNode = Text | Element | Comment; export type Transition = { - // effect + /** effect */ e: EffectSignal; - // payload + /** payload */ p: null | TransitionPayload; - // init + /** init */ i: (from?: DOMRect) => TransitionPayload; - // finished + /** finished */ f: (fn: () => void) => void; in: () => void; - // out + /** out */ o: () => void; - // cancel + /** cancel */ c: () => void; - // cleanup + /** cleanup */ x: () => void; - // direction + /** direction */ r: 'in' | 'out' | 'both' | 'key'; - // dom + /** dom */ d: HTMLElement; }; export type RootBlock = { - // dom + /** dom */ d: null | TemplateNode | Array; - // effect + /** effect */ e: null | ComputationSignal; - // intro + /** intro */ i: boolean; - // parent + /** parent */ p: null; - // transition + /** transition */ r: null | ((transition: Transition) => void); - // type + /** type */ t: typeof ROOT_BLOCK; }; export type IfBlock = { - // current + /** current */ c: boolean; - // dom + /** dom */ d: null | TemplateNode | Array; - // effect + /** effect */ e: null | ComputationSignal; - // parent + /** parent */ p: Block; - // transition + /** transition */ r: null | ((transition: Transition) => void); - // type + /** type */ t: typeof IF_BLOCK; }; export type KeyBlock = { - // dom + /** dom */ d: null | TemplateNode | Array; - // effect + /** effect */ e: null | ComputationSignal; - // parent + /** parent */ p: Block; - // transition + /** transition */ r: null | ((transition: Transition) => void); - // type + /** type */ t: typeof KEY_BLOCK; }; export type HeadBlock = { - // dom + /** dom */ d: null | TemplateNode | Array; - // effect + /** effect */ e: null | ComputationSignal; - // parent + /** parent */ p: Block; - // transition + /** transition */ r: null | ((transition: Transition) => void); - // type + /** type */ t: typeof HEAD_BLOCK; }; export type DynamicElementBlock = { - // dom + /** dom */ d: null | TemplateNode | Array; - // effect + /** effect */ e: null | ComputationSignal; - // parent + /** parent */ p: Block; - // transition + /** transition */ r: null | ((transition: Transition) => void); - // type + /** type */ t: typeof DYNAMIC_ELEMENT_BLOCK; }; export type DynamicComponentBlock = { - // dom + /** dom */ d: null | TemplateNode | Array; - // effect + /** effect */ e: null | ComputationSignal; - // parent + /** parent */ p: Block; - // transition + /** transition */ r: null | ((transition: Transition) => void); - // type + /** type */ t: typeof DYNAMIC_COMPONENT_BLOCK; }; export type AwaitBlock = { - // dom + /** dom */ d: null | TemplateNode | Array; - // effect + /** effect */ e: null | ComputationSignal; - // parent + /** parent */ p: Block; - // pending + /** pending */ n: boolean; - // transition + /** transition */ r: null | ((transition: Transition) => void); - // type + /** type */ t: typeof AWAIT_BLOCK; }; export type EachBlock = { - // anchor + /** anchor */ a: Element | Comment; - // flags + /** flags */ f: number; - // dom + /** dom */ d: null | TemplateNode | Array; - // items + /** items */ v: EachItemBlock[]; - // effect + /** effewct */ e: null | ComputationSignal; - // parent + /** parent */ p: Block; - // transition + /** transition */ r: null | ((transition: Transition) => void); - // transitions + /** transitions */ s: Array; - // type + /** type */ t: typeof EACH_BLOCK; }; export type EachItemBlock = { - // dom + /** dom */ d: null | TemplateNode | Array; - // effect + /** effect */ e: null | ComputationSignal; - // item + /** item */ v: any | Signal; - // index + /** index */ i: number | Signal; - // key + /** key */ k: unknown; - // parent + /** parent */ p: EachBlock; - // transition + /** transition */ r: null | ((transition: Transition) => void); - // transitions + /** transitions */ s: null | Set; - // type + /** type */ t: typeof EACH_ITEM_BLOCK; }; export type SnippetBlock = { - // dom + /** dom */ d: null | TemplateNode | Array; - // parent + /** parent */ p: Block; - // effect + /** effect */ e: null | ComputationSignal; - // transition + /** transition */ r: null; - // type + /** type */ t: typeof SNIPPET_BLOCK; }; @@ -344,13 +347,13 @@ export type StoreReferencesContainer = Record< export type ActionPayload

= { destroy?: () => void; update?: (value: P) => void }; export type Render = { - // dom + /** dom */ d: null | TemplateNode | Array; - // effect + /** effect */ e: null | EffectSignal; - // transitions + /** transitions */ s: Set; - // prev + /** prev */ p: Render | null; };