ember-nativescript 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +353 -2
  3. package/dist/components/NativeFrame.d.ts +28 -0
  4. package/dist/components/NativeFrame.d.ts.map +1 -0
  5. package/dist/components/NativeFrame.js +39 -0
  6. package/dist/components/NativeFrame.js.map +1 -0
  7. package/dist/components/NativeList.d.ts +32 -0
  8. package/dist/components/NativeList.d.ts.map +1 -0
  9. package/dist/components/NativeList.js +44 -0
  10. package/dist/components/NativeList.js.map +1 -0
  11. package/dist/components/Platform.d.ts +21 -0
  12. package/dist/components/Platform.d.ts.map +1 -0
  13. package/dist/components/Platform.js +22 -0
  14. package/dist/components/Platform.js.map +1 -0
  15. package/dist/src/adapter.d.ts +51 -0
  16. package/dist/src/adapter.d.ts.map +1 -0
  17. package/dist/src/bind.d.ts +12 -0
  18. package/dist/src/bind.d.ts.map +1 -0
  19. package/dist/src/bind.js +32 -0
  20. package/dist/src/bind.js.map +1 -0
  21. package/dist/src/dom.d.ts +104 -0
  22. package/dist/src/dom.d.ts.map +1 -0
  23. package/dist/src/dom.js +329 -0
  24. package/dist/src/dom.js.map +1 -0
  25. package/dist/src/elements.d.ts +17 -0
  26. package/dist/src/elements.d.ts.map +1 -0
  27. package/dist/src/elements.js +52 -0
  28. package/dist/src/elements.js.map +1 -0
  29. package/dist/src/fake-adapter.d.ts +113 -0
  30. package/dist/src/fake-adapter.d.ts.map +1 -0
  31. package/dist/src/fake-adapter.js +391 -0
  32. package/dist/src/fake-adapter.js.map +1 -0
  33. package/dist/src/frame-host.d.ts +12 -0
  34. package/dist/src/frame-host.d.ts.map +1 -0
  35. package/dist/src/frame-host.js +34 -0
  36. package/dist/src/frame-host.js.map +1 -0
  37. package/dist/src/index.d.ts +18 -0
  38. package/dist/src/index.d.ts.map +1 -0
  39. package/dist/src/index.js +17 -0
  40. package/dist/src/list.d.ts +21 -0
  41. package/dist/src/list.d.ts.map +1 -0
  42. package/dist/src/list.js +96 -0
  43. package/dist/src/list.js.map +1 -0
  44. package/dist/src/modifier.d.ts +11 -0
  45. package/dist/src/modifier.d.ts.map +1 -0
  46. package/dist/src/modifier.js +27 -0
  47. package/dist/src/modifier.js.map +1 -0
  48. package/dist/src/native-view.d.ts +10 -0
  49. package/dist/src/native-view.d.ts.map +1 -0
  50. package/dist/src/native-view.js +8 -0
  51. package/dist/src/native-view.js.map +1 -0
  52. package/dist/src/nativescript-adapter.d.ts +26 -0
  53. package/dist/src/nativescript-adapter.d.ts.map +1 -0
  54. package/dist/src/nativescript-adapter.js +168 -0
  55. package/dist/src/nativescript-adapter.js.map +1 -0
  56. package/dist/src/nativescript-app.d.ts +18 -0
  57. package/dist/src/nativescript-app.d.ts.map +1 -0
  58. package/dist/src/nativescript-app.js +32 -0
  59. package/dist/src/nativescript-app.js.map +1 -0
  60. package/dist/src/navigator.d.ts +65 -0
  61. package/dist/src/navigator.d.ts.map +1 -0
  62. package/dist/src/navigator.js +141 -0
  63. package/dist/src/navigator.js.map +1 -0
  64. package/dist/src/owner.d.ts +39 -0
  65. package/dist/src/owner.d.ts.map +1 -0
  66. package/dist/src/owner.js +185 -0
  67. package/dist/src/owner.js.map +1 -0
  68. package/dist/src/platform.d.ts +5 -0
  69. package/dist/src/platform.d.ts.map +1 -0
  70. package/dist/src/platform.js +11 -0
  71. package/dist/src/platform.js.map +1 -0
  72. package/dist/src/render.d.ts +18 -0
  73. package/dist/src/render.d.ts.map +1 -0
  74. package/dist/src/render.js +32 -0
  75. package/dist/src/render.js.map +1 -0
  76. package/dist/types/glint.d.ts +164 -0
  77. package/dist/vendor/runtime--fcdnjmJ.js +43 -0
  78. package/dist/vendor/runtime--fcdnjmJ.js.map +1 -0
  79. package/package.json +72 -4
@@ -0,0 +1,52 @@
1
+ // src/elements.ts
2
+ var definitions = /* @__PURE__ */ new Map();
3
+ /** Adds or extends the rules for a tag. Plugins with composite views (a pager and its items…) describe them here. */
4
+ function defineElement(tag, definition) {
5
+ const current = definitions.get(tag);
6
+ definitions.set(tag, {
7
+ slotIn: {
8
+ ...current?.slotIn,
9
+ ...definition.slotIn
10
+ },
11
+ childSlot: definition.childSlot ?? current?.childSlot
12
+ });
13
+ }
14
+ /** The property a `childTag` element goes into inside a `parentTag` element, or undefined when it's a child view. */
15
+ function slotFor(parentTag, childTag) {
16
+ return definitions.get(childTag)?.slotIn?.[parentTag] ?? definitions.get(parentTag)?.childSlot;
17
+ }
18
+ var TEXT_TAGS = [
19
+ "label",
20
+ "button",
21
+ "textField",
22
+ "textView"
23
+ ];
24
+ defineElement("actionBar", {
25
+ slotIn: { page: { property: "actionBar" } },
26
+ childSlot: { property: "titleView" }
27
+ });
28
+ defineElement("navigationButton", { slotIn: { actionBar: { property: "navigationButton" } } });
29
+ defineElement("actionItem", {
30
+ slotIn: { actionBar: {
31
+ property: "actionItems",
32
+ list: true
33
+ } },
34
+ childSlot: { property: "actionView" }
35
+ });
36
+ defineElement("formattedString", { slotIn: Object.fromEntries(TEXT_TAGS.map((tag) => [tag, { property: "formattedText" }])) });
37
+ defineElement("span", { slotIn: { formattedString: {
38
+ property: "spans",
39
+ list: true
40
+ } } });
41
+ defineElement("segmentedBar", { childSlot: {
42
+ property: "items",
43
+ list: true
44
+ } });
45
+ defineElement("tabView", { childSlot: {
46
+ property: "items",
47
+ list: true
48
+ } });
49
+ defineElement("tabViewItem", { childSlot: { property: "view" } });
50
+ export { defineElement, slotFor };
51
+
52
+ //# sourceMappingURL=elements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.js","names":[],"sources":["../../src/elements.ts"],"sourcesContent":["// How elements fit together beyond child views. Most children are views their parent lays out, but some go into a\n// property of the parent: a page's ActionBar, an ActionBar's items, a label's FormattedString and its spans, a\n// SegmentedBar's or TabView's items, a TabViewItem's view. NativeScript's XML builder makes the same choices in each\n// class's _addChildFromBuilder; these rules repeat them so the DOM shim can apply them as Glimmer inserts and removes\n// elements, in order and in both directions.\n\nexport interface Slot {\n /** The parent's property the child goes into. */\n property: string;\n /** Whether the property holds a list of children rather than one. */\n list?: boolean;\n}\n\nexport interface ElementDefinition {\n /** Where this element goes inside a parent with one of these tags, instead of being one of its views. */\n slotIn?: Record<string, Slot>;\n /** Where every child of this element goes that has no slotIn rule of its own for it. */\n childSlot?: Slot;\n}\n\nconst definitions = new Map<string, ElementDefinition>();\n\n/** Adds or extends the rules for a tag. Plugins with composite views (a pager and its items…) describe them here. */\nexport function defineElement(tag: string, definition: ElementDefinition): void {\n const current = definitions.get(tag);\n definitions.set(tag, {\n slotIn: { ...current?.slotIn, ...definition.slotIn },\n childSlot: definition.childSlot ?? current?.childSlot,\n });\n}\n\n/** The property a `childTag` element goes into inside a `parentTag` element, or undefined when it's a child view. */\nexport function slotFor(parentTag: string, childTag: string): Slot | undefined {\n return definitions.get(childTag)?.slotIn?.[parentTag] ?? definitions.get(parentTag)?.childSlot;\n}\n\nconst TEXT_TAGS = ['label', 'button', 'textField', 'textView'];\n\ndefineElement('actionBar', { slotIn: { page: { property: 'actionBar' } }, childSlot: { property: 'titleView' } });\ndefineElement('navigationButton', { slotIn: { actionBar: { property: 'navigationButton' } } });\ndefineElement('actionItem', {\n slotIn: { actionBar: { property: 'actionItems', list: true } },\n childSlot: { property: 'actionView' },\n});\ndefineElement('formattedString', {\n slotIn: Object.fromEntries(TEXT_TAGS.map((tag) => [tag, { property: 'formattedText' }])),\n});\ndefineElement('span', { slotIn: { formattedString: { property: 'spans', list: true } } });\ndefineElement('segmentedBar', { childSlot: { property: 'items', list: true } });\ndefineElement('tabView', { childSlot: { property: 'items', list: true } });\ndefineElement('tabViewItem', { childSlot: { property: 'view' } });\n"],"mappings":";AAoBA,IAAM,8BAAc,IAAI,IAA+B;;AAGvD,SAAgB,cAAc,KAAa,YAAqC;CAC9E,MAAM,UAAU,YAAY,IAAI,GAAG;CACnC,YAAY,IAAI,KAAK;EACnB,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,WAAW;EAAO;EACnD,WAAW,WAAW,aAAa,SAAS;CAC9C,CAAC;AACH;;AAGA,SAAgB,QAAQ,WAAmB,UAAoC;CAC7E,OAAO,YAAY,IAAI,QAAQ,CAAC,EAAE,SAAS,cAAc,YAAY,IAAI,SAAS,CAAC,EAAE;AACvF;AAEA,IAAM,YAAY;CAAC;CAAS;CAAU;CAAa;AAAU;AAE7D,cAAc,aAAa;CAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,YAAY,EAAE;CAAG,WAAW,EAAE,UAAU,YAAY;AAAE,CAAC;AAChH,cAAc,oBAAoB,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,mBAAmB,EAAE,EAAE,CAAC;AAC7F,cAAc,cAAc;CAC1B,QAAQ,EAAE,WAAW;EAAE,UAAU;EAAe,MAAM;CAAK,EAAE;CAC7D,WAAW,EAAE,UAAU,aAAa;AACtC,CAAC;AACD,cAAc,mBAAmB,EAC/B,QAAQ,OAAO,YAAY,UAAU,KAAK,QAAQ,CAAC,KAAK,EAAE,UAAU,gBAAgB,CAAC,CAAC,CAAC,EACzF,CAAC;AACD,cAAc,QAAQ,EAAE,QAAQ,EAAE,iBAAiB;CAAE,UAAU;CAAS,MAAM;AAAK,EAAE,EAAE,CAAC;AACxF,cAAc,gBAAgB,EAAE,WAAW;CAAE,UAAU;CAAS,MAAM;AAAK,EAAE,CAAC;AAC9E,cAAc,WAAW,EAAE,WAAW;CAAE,UAAU;CAAS,MAAM;AAAK,EAAE,CAAC;AACzE,cAAc,eAAe,EAAE,WAAW,EAAE,UAAU,OAAO,EAAE,CAAC"}
@@ -0,0 +1,113 @@
1
+ import type { ListBinding, Listener, ListOptions, NativeAdapter } from './adapter.js';
2
+ import type { FrameHost, ModalHostOptions, ShowOptions } from './navigator.js';
3
+ export declare const FAKE_TAGS: Set<string>;
4
+ export declare class FakeView {
5
+ readonly tag: string;
6
+ /** Properties as strings, for toXML() and assertions. */
7
+ readonly props: Map<string, string>;
8
+ /** Properties as they were set. */
9
+ readonly values: Map<string, unknown>;
10
+ readonly children: FakeView[];
11
+ readonly listeners: Map<string, Set<Listener>>;
12
+ /** Children that went into a property (a page's actionBar, an ActionBar's actionItems). */
13
+ readonly slots: Map<string, FakeView | FakeView[]>;
14
+ parent: FakeView | null;
15
+ /** For a listView bound to rows: what scrolling and layout do to it. */
16
+ list?: FakeList;
17
+ /** For a frame: its pages and modals. */
18
+ frame?: FakeFrame;
19
+ constructor(tag: string);
20
+ get content(): FakeView | undefined;
21
+ get text(): string | undefined;
22
+ /** Fires an event the way NativeScript's View.notify does, with { eventName, object }. */
23
+ notify(eventName: string, extra?: Record<string, unknown>): void;
24
+ /** What a user typing does to a TextField: set `text`, then fire `textChange`. */
25
+ type(value: string): void;
26
+ /** A slot's content: one view, a list, or nothing. */
27
+ slot(property: string): FakeView | FakeView[] | undefined;
28
+ /** Every view under this one, in slots first and then children. */
29
+ get descendants(): FakeView[];
30
+ get listenerCount(): number;
31
+ find(predicate: (view: FakeView) => boolean): FakeView | undefined;
32
+ findAll(predicate: (view: FakeView) => boolean, into?: FakeView[]): FakeView[];
33
+ byId(id: string): FakeView;
34
+ toXML(indent?: string): string;
35
+ }
36
+ /**
37
+ * What a ListView does with its cells, in memory: it shows `visible` rows from `first`, keeps a container per row on
38
+ * screen, and puts the containers of rows that scroll away in a pool to show the next ones. As on a device, it asks
39
+ * for cells on a layout pass, not when the row count changes.
40
+ */
41
+ export declare class FakeList {
42
+ #private;
43
+ readonly view: FakeView;
44
+ readonly adapter: FakeAdapter;
45
+ readonly cell: (container: FakeView, index: number) => void;
46
+ readonly options: ListOptions;
47
+ visible: number;
48
+ count: number;
49
+ first: number;
50
+ /** How many times the list asked for a cell. */
51
+ loads: number;
52
+ /** How many times the list fired loadMoreItems. */
53
+ loadMores: number;
54
+ released: boolean;
55
+ constructor(view: FakeView, adapter: FakeAdapter, cell: (container: FakeView, index: number) => void, options?: ListOptions, visible?: number);
56
+ setCount(count: number): void;
57
+ /** Scrolls so that row `first` is at the top, and lays out. */
58
+ scrollTo(first: number): void;
59
+ /** The kind of a container: the template it was made from. */
60
+ kindOf(container: FakeView): string | undefined;
61
+ /**
62
+ * The platform's layout pass: rows that left the screen give their containers back to the pool of their kind, rows
63
+ * that came on get one of their kind (from the pool first), and after a change of rows every row on screen is asked
64
+ * for again, as ListView.refresh() does. Loading the last row fires loadMoreItems, as ListView does on both platforms.
65
+ */
66
+ layout(): void;
67
+ /** What a tap on the row at an index does: the list fires itemTap with that index and the cell. */
68
+ tap(index: number): void;
69
+ /** Every container the list has made, on screen or in the pools. */
70
+ get containers(): FakeView[];
71
+ }
72
+ /**
73
+ * NativeScript's Frame, in memory: a stack of pages that fire `navigatedFrom` and `navigatedTo` with
74
+ * `isBackNavigation` as the real one does, honouring clearHistory and backstackVisible, plus modals over the top page.
75
+ */
76
+ export declare class FakeFrame implements FrameHost<FakeView> {
77
+ #private;
78
+ readonly stack: FakeView[];
79
+ readonly shown: Array<{
80
+ page: FakeView;
81
+ } & ShowOptions>;
82
+ readonly modals: Array<{
83
+ view: FakeView;
84
+ } & ModalHostOptions>;
85
+ get top(): FakeView;
86
+ show(page: FakeView, options: ShowOptions): void;
87
+ /** What Frame.goBack() does, and what Android's back button and iOS's swipe do. */
88
+ back(): void;
89
+ showModal(view: FakeView, options: ModalHostOptions): void;
90
+ closeModal(view: FakeView, result: unknown): void;
91
+ /** What a swipe down on iOS or the back button on Android does to a modal: it closes with no result. */
92
+ dismissModal(): void;
93
+ }
94
+ export declare class FakeAdapter implements NativeAdapter<FakeView> {
95
+ readonly platform: 'ios' | 'android';
96
+ /** Every view the adapter made, to check that destroyed screens let go of theirs. */
97
+ readonly created: FakeView[];
98
+ constructor(platform?: 'ios' | 'android');
99
+ createView(tag: string): FakeView | null;
100
+ setProperty(view: FakeView, name: string, value: unknown): void;
101
+ hasProperty(_view: FakeView, name: string): boolean;
102
+ takesText(view: FakeView): boolean;
103
+ insertChild(parent: FakeView, child: FakeView, index: number): void;
104
+ removeChild(parent: FakeView, child: FakeView): void;
105
+ setSlot(parent: FakeView, property: string, child: FakeView | null): void;
106
+ insertInSlot(parent: FakeView, property: string, child: FakeView, index: number): void;
107
+ removeFromSlot(parent: FakeView, property: string, child: FakeView): void;
108
+ on(view: FakeView, event: string, listener: Listener): void;
109
+ off(view: FakeView, event: string, listener: Listener): void;
110
+ frameHost(view: FakeView): FrameHost<FakeView> | null;
111
+ bindList(view: FakeView, cell: (container: FakeView, index: number) => void, options?: ListOptions): ListBinding | null;
112
+ }
113
+ //# sourceMappingURL=fake-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fake-adapter.d.ts","sourceRoot":"","sources":["../../src/fake-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAuD/E,eAAO,MAAM,SAAS,aAAyD,CAAC;AAEhF,qBAAa,QAAQ;IAeP,QAAQ,CAAC,GAAG,EAAE,MAAM;IAdhC,yDAAyD;IACzD,QAAQ,CAAC,KAAK,sBAA6B;IAC3C,mCAAmC;IACnC,QAAQ,CAAC,MAAM,uBAA8B;IAC7C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAM;IACnC,QAAQ,CAAC,SAAS,6BAAoC;IACtD,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,qCAA4C;IAC1D,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAC/B,wEAAwE;IACxE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,yCAAyC;IACzC,KAAK,CAAC,EAAE,SAAS,CAAC;gBAEG,GAAG,EAAE,MAAM;IAEhC,IAAI,OAAO,IAAI,QAAQ,GAAG,SAAS,CAElC;IAED,IAAI,IAAI,I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AAK,IAAI,EAClD,OAAO,CAAC,EAAE,WAAW,GACpB,WAAW,GAAG,IAAI;CAUtB"}
@@ -0,0 +1,391 @@
1
+ // src/fake-adapter.ts
2
+ var LAYOUTS = /* @__PURE__ */ new Set([
3
+ "stackLayout",
4
+ "flexboxLayout",
5
+ "gridLayout",
6
+ "wrapLayout",
7
+ "absoluteLayout",
8
+ "dockLayout",
9
+ "rootLayout"
10
+ ]);
11
+ var CONTENT_VIEWS = /* @__PURE__ */ new Set([
12
+ "page",
13
+ "scrollView",
14
+ "contentView"
15
+ ]);
16
+ var TEXT_VIEWS = /* @__PURE__ */ new Set([
17
+ "label",
18
+ "button",
19
+ "textField",
20
+ "textView",
21
+ "span"
22
+ ]);
23
+ var LEAF_VIEWS = /* @__PURE__ */ new Set([
24
+ ...TEXT_VIEWS,
25
+ "frame",
26
+ "image",
27
+ "switch",
28
+ "slider",
29
+ "activityIndicator",
30
+ "listView",
31
+ "actionBar",
32
+ "actionItem",
33
+ "navigationButton",
34
+ "datePicker",
35
+ "timePicker",
36
+ "listPicker",
37
+ "progress",
38
+ "searchBar",
39
+ "segmentedBar",
40
+ "segmentedBarItem",
41
+ "tabView",
42
+ "tabViewItem",
43
+ "webView",
44
+ "htmlView",
45
+ "placeholder",
46
+ "formattedString"
47
+ ]);
48
+ var NOT_PROPERTIES = /* @__PURE__ */ new Set([
49
+ "class",
50
+ "style",
51
+ "row",
52
+ "col",
53
+ "rowSpan",
54
+ "colSpan",
55
+ "dock",
56
+ "left",
57
+ "top",
58
+ "order",
59
+ "element"
60
+ ]);
61
+ var FAKE_TAGS = /* @__PURE__ */ new Set([
62
+ ...LAYOUTS,
63
+ ...CONTENT_VIEWS,
64
+ ...LEAF_VIEWS
65
+ ]);
66
+ var FakeView = class {
67
+ tag;
68
+ /** Properties as strings, for toXML() and assertions. */
69
+ props = /* @__PURE__ */ new Map();
70
+ /** Properties as they were set. */
71
+ values = /* @__PURE__ */ new Map();
72
+ children = [];
73
+ listeners = /* @__PURE__ */ new Map();
74
+ /** Children that went into a property (a page's actionBar, an ActionBar's actionItems). */
75
+ slots = /* @__PURE__ */ new Map();
76
+ parent = null;
77
+ /** For a listView bound to rows: what scrolling and layout do to it. */
78
+ list;
79
+ /** For a frame: its pages and modals. */
80
+ frame;
81
+ constructor(tag) {
82
+ this.tag = tag;
83
+ }
84
+ get content() {
85
+ return CONTENT_VIEWS.has(this.tag) ? this.children[0] : void 0;
86
+ }
87
+ get text() {
88
+ return this.props.get("text");
89
+ }
90
+ /** Fires an event the way NativeScript's View.notify does, with { eventName, object }. */
91
+ notify(eventName, extra = {}) {
92
+ for (const listener of [...this.listeners.get(eventName) ?? []]) listener({
93
+ eventName,
94
+ object: this,
95
+ ...extra
96
+ });
97
+ }
98
+ /** What a user typing does to a TextField: set `text`, then fire `textChange`. */
99
+ type(value) {
100
+ const old = this.props.get("text");
101
+ this.props.set("text", value);
102
+ this.values.set("text", value);
103
+ this.notify("textChange", {
104
+ propertyName: "text",
105
+ value,
106
+ oldValue: old
107
+ });
108
+ }
109
+ /** A slot's content: one view, a list, or nothing. */
110
+ slot(property) {
111
+ return this.slots.get(property);
112
+ }
113
+ /** Every view under this one, in slots first and then children. */
114
+ get descendants() {
115
+ return [...[...this.slots.values()].flat(), ...this.children];
116
+ }
117
+ get listenerCount() {
118
+ let count = 0;
119
+ for (const set of this.listeners.values()) count += set.size;
120
+ for (const child of this.descendants) count += child.listenerCount;
121
+ return count;
122
+ }
123
+ find(predicate) {
124
+ if (predicate(this)) return this;
125
+ for (const child of this.descendants) {
126
+ const found = child.find(predicate);
127
+ if (found) return found;
128
+ }
129
+ }
130
+ findAll(predicate, into = []) {
131
+ if (predicate(this)) into.push(this);
132
+ for (const child of this.descendants) child.findAll(predicate, into);
133
+ return into;
134
+ }
135
+ byId(id) {
136
+ const found = this.find((view) => view.props.get("id") === id);
137
+ if (!found) throw new Error(`No view with id ${id} in\n${this.toXML()}`);
138
+ return found;
139
+ }
140
+ toXML(indent = "") {
141
+ const props = [...this.props].map(([name, value]) => ` ${name}="${value}"`).join("");
142
+ const inner = [...[...this.slots].map(([property, content]) => {
143
+ const inner = [content].flat().map((view) => view.toXML(`${indent} `)).join("\n");
144
+ return `${indent} <${this.tag}.${property}>\n${inner}\n${indent} </${this.tag}.${property}>`;
145
+ }), ...this.children.map((child) => child.toXML(`${indent} `))];
146
+ if (!inner.length) return `${indent}<${this.tag}${props} />`;
147
+ return `${indent}<${this.tag}${props}>\n${inner.join("\n")}\n${indent}</${this.tag}>`;
148
+ }
149
+ };
150
+ /**
151
+ * What a ListView does with its cells, in memory: it shows `visible` rows from `first`, keeps a container per row on
152
+ * screen, and puts the containers of rows that scroll away in a pool to show the next ones. As on a device, it asks
153
+ * for cells on a layout pass, not when the row count changes.
154
+ */
155
+ var FakeList = class {
156
+ view;
157
+ adapter;
158
+ cell;
159
+ options;
160
+ visible;
161
+ count = 0;
162
+ first = 0;
163
+ /** How many times the list asked for a cell. */
164
+ loads = 0;
165
+ /** How many times the list fired loadMoreItems. */
166
+ loadMores = 0;
167
+ released = false;
168
+ #shown = /* @__PURE__ */ new Map();
169
+ #pools = /* @__PURE__ */ new Map();
170
+ #kinds = /* @__PURE__ */ new WeakMap();
171
+ #stale = false;
172
+ constructor(view, adapter, cell, options = {}, visible = 10) {
173
+ this.view = view;
174
+ this.adapter = adapter;
175
+ this.cell = cell;
176
+ this.options = options;
177
+ this.visible = visible;
178
+ }
179
+ setCount(count) {
180
+ this.count = count;
181
+ this.#stale = true;
182
+ }
183
+ /** Scrolls so that row `first` is at the top, and lays out. */
184
+ scrollTo(first) {
185
+ this.first = first;
186
+ this.layout();
187
+ }
188
+ /** The kind of a container: the template it was made from. */
189
+ kindOf(container) {
190
+ return this.#kinds.get(container);
191
+ }
192
+ #kindAt(index) {
193
+ return this.options.kindOf?.(index) ?? "default";
194
+ }
195
+ #pool(kind) {
196
+ let pool = this.#pools.get(kind);
197
+ if (!pool) this.#pools.set(kind, pool = []);
198
+ return pool;
199
+ }
200
+ #release(index, container) {
201
+ this.#shown.delete(index);
202
+ this.#pool(this.#kinds.get(container)).push(container);
203
+ }
204
+ /**
205
+ * The platform's layout pass: rows that left the screen give their containers back to the pool of their kind, rows
206
+ * that came on get one of their kind (from the pool first), and after a change of rows every row on screen is asked
207
+ * for again, as ListView.refresh() does. Loading the last row fires loadMoreItems, as ListView does on both platforms.
208
+ */
209
+ layout() {
210
+ if (this.released) return;
211
+ const end = Math.min(this.first + this.visible, this.count);
212
+ for (const [index, container] of this.#shown) if (index < this.first || index >= end || this.#stale && this.#kinds.get(container) !== this.#kindAt(index)) this.#release(index, container);
213
+ let loadedLast = false;
214
+ for (let index = this.first; index < end; index++) {
215
+ let container = this.#shown.get(index);
216
+ if (!container) {
217
+ const kind = this.#kindAt(index);
218
+ container = this.#pool(kind).pop();
219
+ if (!container) {
220
+ container = this.adapter.createView("stackLayout");
221
+ this.#kinds.set(container, kind);
222
+ }
223
+ this.#shown.set(index, container);
224
+ } else if (!this.#stale) continue;
225
+ this.loads++;
226
+ this.cell(container, index);
227
+ if (index === this.count - 1) loadedLast = true;
228
+ }
229
+ this.#stale = false;
230
+ for (const child of this.view.children) child.parent = null;
231
+ const shown = [...this.#shown].sort(([a], [b]) => a - b).map(([, container]) => container);
232
+ this.view.children.splice(0, this.view.children.length, ...shown);
233
+ for (const child of shown) child.parent = this.view;
234
+ if (loadedLast) {
235
+ this.loadMores++;
236
+ this.view.notify("loadMoreItems");
237
+ }
238
+ }
239
+ /** What a tap on the row at an index does: the list fires itemTap with that index and the cell. */
240
+ tap(index) {
241
+ this.view.notify("itemTap", {
242
+ index,
243
+ view: this.#shown.get(index)
244
+ });
245
+ }
246
+ /** Every container the list has made, on screen or in the pools. */
247
+ get containers() {
248
+ return [...this.#shown.values(), ...[...this.#pools.values()].flat()];
249
+ }
250
+ };
251
+ /**
252
+ * NativeScript's Frame, in memory: a stack of pages that fire `navigatedFrom` and `navigatedTo` with
253
+ * `isBackNavigation` as the real one does, honouring clearHistory and backstackVisible, plus modals over the top page.
254
+ */
255
+ var FakeFrame = class {
256
+ stack = [];
257
+ shown = [];
258
+ modals = [];
259
+ #hidden = /* @__PURE__ */ new WeakSet();
260
+ get top() {
261
+ return this.stack.at(-1);
262
+ }
263
+ show(page, options) {
264
+ const previous = this.stack.at(-1);
265
+ this.shown.push({
266
+ page,
267
+ ...options
268
+ });
269
+ previous?.notify("navigatedFrom", { isBackNavigation: false });
270
+ if (options.clearHistory) this.stack.length = 0;
271
+ else if (previous && this.#hidden.has(previous)) this.stack.pop();
272
+ if (!options.backstackVisible) this.#hidden.add(page);
273
+ this.stack.push(page);
274
+ page.notify("navigatedTo", { isBackNavigation: false });
275
+ }
276
+ /** What Frame.goBack() does, and what Android's back button and iOS's swipe do. */
277
+ back() {
278
+ if (this.stack.length < 2) return;
279
+ this.stack.pop().notify("navigatedFrom", { isBackNavigation: true });
280
+ this.top.notify("navigatedTo", { isBackNavigation: true });
281
+ }
282
+ showModal(view, options) {
283
+ this.modals.push({
284
+ view,
285
+ ...options
286
+ });
287
+ }
288
+ closeModal(view, result) {
289
+ const index = this.modals.findIndex((modal) => modal.view === view);
290
+ if (index === -1) return;
291
+ const [modal] = this.modals.splice(index, 1);
292
+ modal.onClose(result);
293
+ }
294
+ /** What a swipe down on iOS or the back button on Android does to a modal: it closes with no result. */
295
+ dismissModal() {
296
+ this.modals.pop()?.onClose();
297
+ }
298
+ };
299
+ var FakeAdapter = class {
300
+ platform;
301
+ /** Every view the adapter made, to check that destroyed screens let go of theirs. */
302
+ created = [];
303
+ constructor(platform = "ios") {
304
+ this.platform = platform;
305
+ }
306
+ createView(tag) {
307
+ if (!FAKE_TAGS.has(tag)) return null;
308
+ const view = new FakeView(tag);
309
+ this.created.push(view);
310
+ return view;
311
+ }
312
+ setProperty(view, name, value) {
313
+ if (value === null || value === void 0) {
314
+ view.props.delete(name);
315
+ view.values.delete(name);
316
+ } else {
317
+ view.props.set(name, value instanceof Date ? value.toISOString() : String(value));
318
+ view.values.set(name, value);
319
+ }
320
+ }
321
+ hasProperty(_view, name) {
322
+ return !NOT_PROPERTIES.has(name);
323
+ }
324
+ takesText(view) {
325
+ return TEXT_VIEWS.has(view.tag);
326
+ }
327
+ insertChild(parent, child, index) {
328
+ if (LEAF_VIEWS.has(parent.tag)) throw new Error(`<${parent.tag}> can't hold views`);
329
+ if (CONTENT_VIEWS.has(parent.tag) && parent.children.length) throw new Error(`<${parent.tag}> holds one view; it already has <${parent.children[0].tag}>`);
330
+ if (child.parent) throw new Error(`<${child.tag}> already has a parent`);
331
+ child.parent = parent;
332
+ parent.children.splice(index, 0, child);
333
+ }
334
+ removeChild(parent, child) {
335
+ const index = parent.children.indexOf(child);
336
+ if (index === -1) throw new Error(`<${child.tag}> is not a child of <${parent.tag}>`);
337
+ parent.children.splice(index, 1);
338
+ child.parent = null;
339
+ }
340
+ setSlot(parent, property, child) {
341
+ const current = parent.slots.get(property);
342
+ if (current && !Array.isArray(current)) current.parent = null;
343
+ if (!child) {
344
+ parent.slots.delete(property);
345
+ return;
346
+ }
347
+ if (child.parent) throw new Error(`<${child.tag}> already has a parent`);
348
+ child.parent = parent;
349
+ parent.slots.set(property, child);
350
+ }
351
+ insertInSlot(parent, property, child, index) {
352
+ if (child.parent) throw new Error(`<${child.tag}> already has a parent`);
353
+ const list = parent.slots.get(property) ?? [];
354
+ list.splice(index, 0, child);
355
+ parent.slots.set(property, list);
356
+ child.parent = parent;
357
+ }
358
+ removeFromSlot(parent, property, child) {
359
+ const list = parent.slots.get(property);
360
+ const index = list?.indexOf(child) ?? -1;
361
+ if (index === -1) throw new Error(`<${child.tag}> is not in <${parent.tag}>.${property}`);
362
+ list.splice(index, 1);
363
+ if (!list.length) parent.slots.delete(property);
364
+ child.parent = null;
365
+ }
366
+ on(view, event, listener) {
367
+ let set = view.listeners.get(event);
368
+ if (!set) view.listeners.set(event, set = /* @__PURE__ */ new Set());
369
+ set.add(listener);
370
+ }
371
+ off(view, event, listener) {
372
+ view.listeners.get(event)?.delete(listener);
373
+ }
374
+ frameHost(view) {
375
+ if (view.tag !== "frame") return null;
376
+ return view.frame ??= new FakeFrame();
377
+ }
378
+ bindList(view, cell, options) {
379
+ if (view.tag !== "listView") return null;
380
+ const list = view.list = new FakeList(view, this, cell, options);
381
+ return {
382
+ setCount: (count) => list.setCount(count),
383
+ release: () => {
384
+ list.released = true;
385
+ }
386
+ };
387
+ }
388
+ };
389
+ export { FAKE_TAGS, FakeAdapter, FakeFrame, FakeList, FakeView };
390
+
391
+ //# sourceMappingURL=fake-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fake-adapter.js","names":[],"sources":["../../src/fake-adapter.ts"],"sourcesContent":["// An in-memory stand-in for NativeScript's views, for tests in Node: the same tags, a parent/children\n// tree, `content` for single-child views, properties and listeners. `toXML()` prints the tree the way a\n// NativeScript XML page would describe it.\n\nimport type { ListBinding, Listener, ListOptions, NativeAdapter } from './adapter.ts';\nimport type { FrameHost, ModalHostOptions, ShowOptions } from './navigator.ts';\n\nconst LAYOUTS = new Set([\n 'stackLayout',\n 'flexboxLayout',\n 'gridLayout',\n 'wrapLayout',\n 'absoluteLayout',\n 'dockLayout',\n 'rootLayout',\n]);\nconst CONTENT_VIEWS = new Set(['page', 'scrollView', 'contentView']);\nconst TEXT_VIEWS = new Set(['label', 'button', 'textField', 'textView', 'span']);\n// A listView's children are the cells it shows, which only the list itself puts there. The rest hold no child views,\n// though some take children into properties (see elements.ts).\nconst LEAF_VIEWS = new Set([\n ...TEXT_VIEWS,\n 'frame',\n 'image',\n 'switch',\n 'slider',\n 'activityIndicator',\n 'listView',\n 'actionBar',\n 'actionItem',\n 'navigationButton',\n 'datePicker',\n 'timePicker',\n 'listPicker',\n 'progress',\n 'searchBar',\n 'segmentedBar',\n 'segmentedBarItem',\n 'tabView',\n 'tabViewItem',\n 'webView',\n 'htmlView',\n 'placeholder',\n 'formattedString',\n]);\n// Names that aren't properties of a NativeScript view: what a layout or a stylesheet sets, and `element`, which\n// renderComponent probes (`'element' in into`) to tell a cursor from an element. Fake views have every other property.\nconst NOT_PROPERTIES = new Set([\n 'class',\n 'style',\n 'row',\n 'col',\n 'rowSpan',\n 'colSpan',\n 'dock',\n 'left',\n 'top',\n 'order',\n 'element',\n]);\nexport const FAKE_TAGS = new Set([...LAYOUTS, ...CONTENT_VIEWS, ...LEAF_VIEWS]);\n\nexport class FakeView {\n /** Properties as strings, for toXML() and assertions. */\n readonly props = new Map<string, string>();\n /** Properties as they were set. */\n readonly values = new Map<string, unknown>();\n readonly children: FakeView[] = [];\n readonly listeners = new Map<string, Set<Listener>>();\n /** Children that went into a property (a page's actionBar, an ActionBar's actionItems). */\n readonly slots = new Map<string, FakeView | FakeView[]>();\n parent: FakeView | null = null;\n /** For a listView bound to rows: what scrolling and layout do to it. */\n list?: FakeList;\n /** For a frame: its pages and modals. */\n frame?: FakeFrame;\n\n constructor(readonly tag: string) {}\n\n get content(): FakeView | undefined {\n return CONTENT_VIEWS.has(this.tag) ? this.children[0] : undefined;\n }\n\n get text(): string | undefined {\n return this.props.get('text');\n }\n\n /** Fires an event the way NativeScript's View.notify does, with { eventName, object }. */\n notify(eventName: string, extra: Record<string, unknown> = {}): void {\n for (const listener of [...(this.listeners.get(eventName) ?? [])]) {\n listener({ eventName, object: this, ...extra });\n }\n }\n\n /** What a user typing does to a TextField: set `text`, then fire `textChange`. */\n type(value: string): void {\n const old = this.props.get('text');\n this.props.set('text', value);\n this.values.set('text', value);\n this.notify('textChange', { propertyName: 'text', value, oldValue: old });\n }\n\n /** A slot's content: one view, a list, or nothing. */\n slot(property: string): FakeView | FakeView[] | undefined {\n return this.slots.get(property);\n }\n\n /** Every view under this one, in slots first and then children. */\n get descendants(): FakeView[] {\n const slotted = [...this.slots.values()].flat();\n return [...slotted, ...this.children];\n }\n\n get listenerCount(): number {\n let count = 0;\n for (const set of this.listeners.values()) count += set.size;\n for (const child of this.descendants) count += child.listenerCount;\n return count;\n }\n\n find(predicate: (view: FakeView) => boolean): FakeView | undefined {\n if (predicate(this)) return this;\n for (const child of this.descendants) {\n const found = child.find(predicate);\n if (found) return found;\n }\n return undefined;\n }\n\n findAll(predicate: (view: FakeView) => boolean, into: FakeView[] = []): FakeView[] {\n if (predicate(this)) into.push(this);\n for (const child of this.descendants) child.findAll(predicate, into);\n return into;\n }\n\n byId(id: string): FakeView {\n const found = this.find((view) => view.props.get('id') === id);\n if (!found) throw new Error(`No view with id ${id} in\\n${this.toXML()}`);\n return found;\n }\n\n // Slots print the way NativeScript's XML writes a property set to views: <page.actionBar>…</page.actionBar>.\n toXML(indent = ''): string {\n const props = [...this.props].map(([name, value]) => ` ${name}=\"${value}\"`).join('');\n const slots = [...this.slots].map(([property, content]) => {\n const views = [content].flat();\n const inner = views.map((view) => view.toXML(`${indent} `)).join('\\n');\n return `${indent} <${this.tag}.${property}>\\n${inner}\\n${indent} </${this.tag}.${property}>`;\n });\n const inner = [...slots, ...this.children.map((child) => child.toXML(`${indent} `))];\n if (!inner.length) return `${indent}<${this.tag}${props} />`;\n return `${indent}<${this.tag}${props}>\\n${inner.join('\\n')}\\n${indent}</${this.tag}>`;\n }\n}\n\n/**\n * What a ListView does with its cells, in memory: it shows `visible` rows from `first`, keeps a container per row on\n * screen, and puts the containers of rows that scroll away in a pool to show the next ones. As on a device, it asks\n * for cells on a layout pass, not when the row count changes.\n */\nexport class FakeList {\n count = 0;\n first = 0;\n /** How many times the list asked for a cell. */\n loads = 0;\n /** How many times the list fired loadMoreItems. */\n loadMores = 0;\n released = false;\n readonly #shown = new Map<number, FakeView>();\n readonly #pools = new Map<string, FakeView[]>();\n readonly #kinds = new WeakMap<FakeView, string>();\n #stale = false;\n\n constructor(\n readonly view: FakeView,\n readonly adapter: FakeAdapter,\n readonly cell: (container: FakeView, index: number) => void,\n readonly options: ListOptions = {},\n public visible = 10,\n ) {}\n\n setCount(count: number): void {\n this.count = count;\n this.#stale = true;\n }\n\n /** Scrolls so that row `first` is at the top, and lays out. */\n scrollTo(first: number): void {\n this.first = first;\n this.layout();\n }\n\n /** The kind of a container: the template it was made from. */\n kindOf(container: FakeView): string | undefined {\n return this.#kinds.get(container);\n }\n\n #kindAt(index: number): string {\n return this.options.kindOf?.(index) ?? 'default';\n }\n\n #pool(kind: string): FakeView[] {\n let pool = this.#pools.get(kind);\n if (!pool) this.#pools.set(kind, (pool = []));\n return pool;\n }\n\n #release(index: number, container: FakeView): void {\n this.#shown.delete(index);\n this.#pool(this.#kinds.get(container)!).push(container);\n }\n\n /**\n * The platform's layout pass: rows that left the screen give their containers back to the pool of their kind, rows\n * that came on get one of their kind (from the pool first), and after a change of rows every row on screen is asked\n * for again, as ListView.refresh() does. Loading the last row fires loadMoreItems, as ListView does on both platforms.\n */\n layout(): void {\n if (this.released) return;\n\n const end = Math.min(this.first + this.visible, this.count);\n\n for (const [index, container] of this.#shown) {\n const gone = index < this.first || index >= end;\n // After a refresh, a row whose kind changed needs a cell of its new kind.\n if (gone || (this.#stale && this.#kinds.get(container) !== this.#kindAt(index))) this.#release(index, container);\n }\n\n let loadedLast = false;\n\n for (let index = this.first; index < end; index++) {\n let container = this.#shown.get(index);\n\n if (!container) {\n const kind = this.#kindAt(index);\n container = this.#pool(kind).pop();\n if (!container) {\n container = this.adapter.createView('stackLayout')!;\n this.#kinds.set(container, kind);\n }\n this.#shown.set(index, container);\n } else if (!this.#stale) {\n continue;\n }\n\n this.loads++;\n this.cell(container, index);\n if (index === this.count - 1) loadedLast = true;\n }\n\n this.#stale = false;\n\n for (const child of this.view.children) child.parent = null;\n const shown = [...this.#shown].sort(([a], [b]) => a - b).map(([, container]) => container);\n this.view.children.splice(0, this.view.children.length, ...shown);\n for (const child of shown) child.parent = this.view;\n\n if (loadedLast) {\n this.loadMores++;\n this.view.notify('loadMoreItems');\n }\n }\n\n /** What a tap on the row at an index does: the list fires itemTap with that index and the cell. */\n tap(index: number): void {\n this.view.notify('itemTap', { index, view: this.#shown.get(index) });\n }\n\n /** Every container the list has made, on screen or in the pools. */\n get containers(): FakeView[] {\n return [...this.#shown.values(), ...[...this.#pools.values()].flat()];\n }\n}\n\n/**\n * NativeScript's Frame, in memory: a stack of pages that fire `navigatedFrom` and `navigatedTo` with\n * `isBackNavigation` as the real one does, honouring clearHistory and backstackVisible, plus modals over the top page.\n */\nexport class FakeFrame implements FrameHost<FakeView> {\n readonly stack: FakeView[] = [];\n readonly shown: Array<{ page: FakeView } & ShowOptions> = [];\n readonly modals: Array<{ view: FakeView } & ModalHostOptions> = [];\n // The page on screen stays out of the back stack once another is shown when it was shown with backstackVisible: false.\n readonly #hidden = new WeakSet<FakeView>();\n\n get top(): FakeView {\n return this.stack.at(-1)!;\n }\n\n show(page: FakeView, options: ShowOptions): void {\n const previous = this.stack.at(-1);\n this.shown.push({ page, ...options });\n previous?.notify('navigatedFrom', { isBackNavigation: false });\n if (options.clearHistory) this.stack.length = 0;\n else if (previous && this.#hidden.has(previous)) this.stack.pop();\n if (!options.backstackVisible) this.#hidden.add(page);\n this.stack.push(page);\n page.notify('navigatedTo', { isBackNavigation: false });\n }\n\n /** What Frame.goBack() does, and what Android's back button and iOS's swipe do. */\n back(): void {\n if (this.stack.length < 2) return;\n const page = this.stack.pop()!;\n page.notify('navigatedFrom', { isBackNavigation: true });\n this.top.notify('navigatedTo', { isBackNavigation: true });\n }\n\n showModal(view: FakeView, options: ModalHostOptions): void {\n this.modals.push({ view, ...options });\n }\n\n closeModal(view: FakeView, result: unknown): void {\n const index = this.modals.findIndex((modal) => modal.view === view);\n if (index === -1) return;\n const [modal] = this.modals.splice(index, 1);\n modal!.onClose(result);\n }\n\n /** What a swipe down on iOS or the back button on Android does to a modal: it closes with no result. */\n dismissModal(): void {\n const modal = this.modals.pop();\n modal?.onClose();\n }\n}\n\nexport class FakeAdapter implements NativeAdapter<FakeView> {\n /** Every view the adapter made, to check that destroyed screens let go of theirs. */\n readonly created: FakeView[] = [];\n\n constructor(readonly platform: 'ios' | 'android' = 'ios') {}\n\n createView(tag: string): FakeView | null {\n if (!FAKE_TAGS.has(tag)) return null;\n const view = new FakeView(tag);\n this.created.push(view);\n return view;\n }\n\n setProperty(view: FakeView, name: string, value: unknown): void {\n if (value === null || value === undefined) {\n view.props.delete(name);\n view.values.delete(name);\n } else {\n view.props.set(name, value instanceof Date ? value.toISOString() : String(value));\n view.values.set(name, value);\n }\n }\n\n hasProperty(_view: FakeView, name: string): boolean {\n return !NOT_PROPERTIES.has(name);\n }\n\n takesText(view: FakeView): boolean {\n return TEXT_VIEWS.has(view.tag);\n }\n\n insertChild(parent: FakeView, child: FakeView, index: number): void {\n if (LEAF_VIEWS.has(parent.tag)) throw new Error(`<${parent.tag}> can't hold views`);\n if (CONTENT_VIEWS.has(parent.tag) && parent.children.length) {\n throw new Error(`<${parent.tag}> holds one view; it already has <${parent.children[0]!.tag}>`);\n }\n if (child.parent) throw new Error(`<${child.tag}> already has a parent`);\n child.parent = parent;\n parent.children.splice(index, 0, child);\n }\n\n removeChild(parent: FakeView, child: FakeView): void {\n const index = parent.children.indexOf(child);\n if (index === -1) throw new Error(`<${child.tag}> is not a child of <${parent.tag}>`);\n parent.children.splice(index, 1);\n child.parent = null;\n }\n\n setSlot(parent: FakeView, property: string, child: FakeView | null): void {\n const current = parent.slots.get(property);\n if (current && !Array.isArray(current)) current.parent = null;\n if (!child) {\n parent.slots.delete(property);\n return;\n }\n if (child.parent) throw new Error(`<${child.tag}> already has a parent`);\n child.parent = parent;\n parent.slots.set(property, child);\n }\n\n insertInSlot(parent: FakeView, property: string, child: FakeView, index: number): void {\n if (child.parent) throw new Error(`<${child.tag}> already has a parent`);\n const list = (parent.slots.get(property) as FakeView[] | undefined) ?? [];\n list.splice(index, 0, child);\n parent.slots.set(property, list);\n child.parent = parent;\n }\n\n removeFromSlot(parent: FakeView, property: string, child: FakeView): void {\n const list = parent.slots.get(property) as FakeView[] | undefined;\n const index = list?.indexOf(child) ?? -1;\n if (index === -1) throw new Error(`<${child.tag}> is not in <${parent.tag}>.${property}`);\n list!.splice(index, 1);\n if (!list!.length) parent.slots.delete(property);\n child.parent = null;\n }\n\n on(view: FakeView, event: string, listener: Listener): void {\n let set = view.listeners.get(event);\n if (!set) view.listeners.set(event, (set = new Set()));\n set.add(listener);\n }\n\n off(view: FakeView, event: string, listener: Listener): void {\n view.listeners.get(event)?.delete(listener);\n }\n\n frameHost(view: FakeView): FrameHost<FakeView> | null {\n if (view.tag !== 'frame') return null;\n return (view.frame ??= new FakeFrame());\n }\n\n bindList(\n view: FakeView,\n cell: (container: FakeView, index: number) => void,\n options?: ListOptions,\n ): ListBinding | null {\n if (view.tag !== 'listView') return null;\n const list = (view.list = new FakeList(view, this, cell, options));\n return {\n setCount: (count) => list.setCount(count),\n release: () => {\n list.released = true;\n },\n };\n }\n}\n"],"mappings":";AAOA,IAAM,0BAAU,IAAI,IAAI;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,IAAM,gCAAgB,IAAI,IAAI;CAAC;CAAQ;CAAc;AAAa,CAAC;AACnE,IAAM,6BAAa,IAAI,IAAI;CAAC;CAAS;CAAU;CAAa;CAAY;AAAM,CAAC;AAG/E,IAAM,6BAAa,IAAI,IAAI;CACzB,GAAG;CACH;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAGD,IAAM,iCAAiB,IAAI,IAAI;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,IAAa,4BAAY,IAAI,IAAI;CAAC,GAAG;CAAS,GAAG;CAAe,GAAG;AAAU,CAAC;AAE9E,IAAa,WAAb,MAAsB;CAeC;;CAbZ,wBAAQ,IAAI,IAAoB;;CAEhC,yBAAS,IAAI,IAAqB;CAClC,WAAuB,CAAC;CACxB,4BAAY,IAAI,IAA2B;;CAE3C,wBAAQ,IAAI,IAAmC;CACxD,SAA0B;;CAE1B;;CAEA;CAEA,YAAqB,KAAa;EAAb,KAAA,M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ativeScript Frame and modals over its current page. */
4
+ export declare class FrameNavigationHost implements FrameHost<View> {
5
+ readonly frame: Frame;
6
+ constructor(frame: Frame);
7
+ show(page: View, options: Parameters<FrameHost['show']>[1]): void;
8
+ back(): void;
9
+ showModal(view: View, options: Parameters<FrameHost['showModal']>[1]): void;
10
+ closeModal(view: View, result: unknown): void;
11
+ }
12
+ //# sourceMappingURL=frame-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frame-host.d.ts","sourceRoot":"","sources":["../../src/frame-host.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAA8B,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,4EAA4E;AAC5E,qBAAa,mBAAoB,YAAW,SAAS,CAAC,IAAI,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,KAAK;gBAAZ,KAAK,EAAE,KAAK;IAEjC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAUjE,IAAI,IAAI,IAAI;IAIZ,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAW3E,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;CAG9C"}