growing-panes 0.2.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.
package/dist/index.js ADDED
@@ -0,0 +1,373 @@
1
+ // src/core.ts
2
+ var DEFAULT_MAX_VISIBLE = 2;
3
+ function assertPositiveInteger(value, label) {
4
+ if (!Number.isInteger(value) || value < 1) {
5
+ throw new Error(`${label} must be a positive integer.`);
6
+ }
7
+ }
8
+ function assertNonNegativeInteger(value, label) {
9
+ if (!Number.isInteger(value) || value < 0) {
10
+ throw new Error(`${label} must be a non-negative integer.`);
11
+ }
12
+ }
13
+ function hasOwn(object, key) {
14
+ return Object.prototype.hasOwnProperty.call(object, key);
15
+ }
16
+ function resolveConfig(config) {
17
+ const paneNames = Object.keys(config.panes);
18
+ if (paneNames.length === 0) {
19
+ throw new Error("At least one pane definition is required.");
20
+ }
21
+ const maxVisible = config.display?.maxVisible ?? DEFAULT_MAX_VISIBLE;
22
+ assertPositiveInteger(maxVisible, "display.maxVisible");
23
+ for (const pane of paneNames) {
24
+ const definition = config.panes[pane];
25
+ const paneMaxVisible = definition.display?.maxVisible;
26
+ if (paneMaxVisible !== void 0) {
27
+ assertPositiveInteger(
28
+ paneMaxVisible,
29
+ `panes.${pane}.display.maxVisible`
30
+ );
31
+ }
32
+ for (const parent of definition.canOpenFrom ?? []) {
33
+ if (!hasOwn(config.panes, parent)) {
34
+ throw new Error(
35
+ `Pane "${pane}" references unknown parent pane "${parent}".`
36
+ );
37
+ }
38
+ }
39
+ }
40
+ const initialStack = config.initialStack ?? [];
41
+ const minimumDepth = config.minimumDepth ?? (initialStack.length === 0 ? 0 : 1);
42
+ assertNonNegativeInteger(minimumDepth, "minimumDepth");
43
+ if (minimumDepth > initialStack.length) {
44
+ throw new Error(
45
+ "minimumDepth cannot be greater than the initial stack length."
46
+ );
47
+ }
48
+ return {
49
+ panes: config.panes,
50
+ initialStack,
51
+ maxVisible,
52
+ minimumDepth,
53
+ selectVisiblePanes: config.selectVisiblePanes
54
+ };
55
+ }
56
+ function definitionFor(config, pane) {
57
+ if (!hasOwn(config.panes, pane)) {
58
+ throw new Error(`Unknown pane "${pane}".`);
59
+ }
60
+ return config.panes[pane];
61
+ }
62
+ function generatedKey(pane, seed, stack) {
63
+ const base = `${pane}:${seed}`;
64
+ let key = base;
65
+ let suffix = 2;
66
+ while (stack.some((entry) => entry.key === key)) {
67
+ key = `${base}:${suffix}`;
68
+ suffix += 1;
69
+ }
70
+ return key;
71
+ }
72
+ function entryFromTarget(target, depth, seed, stack) {
73
+ const key = target.key ?? generatedKey(target.pane, seed, stack);
74
+ if (key.length === 0) {
75
+ throw new Error("Pane keys cannot be empty.");
76
+ }
77
+ if (stack.some((entry) => entry.key === key)) {
78
+ throw new Error(`Duplicate pane key "${key}".`);
79
+ }
80
+ return Object.freeze({
81
+ key,
82
+ pane: target.pane,
83
+ params: "params" in target ? target.params : void 0,
84
+ data: "data" in target ? target.data : void 0,
85
+ depth
86
+ });
87
+ }
88
+ function assertCanOpen(config, pane, parent) {
89
+ const definition = definitionFor(config, pane);
90
+ const allowedParents = definition.canOpenFrom;
91
+ if (allowedParents === void 0) {
92
+ return;
93
+ }
94
+ if (parent === void 0 || !allowedParents.includes(parent.pane)) {
95
+ const from = parent === void 0 ? "an empty stack" : `"${parent.pane}"`;
96
+ throw new Error(`Pane "${pane}" cannot open from ${from}.`);
97
+ }
98
+ }
99
+ function buildStack(config, targets, seedOffset) {
100
+ const stack = [];
101
+ targets.forEach((target, index) => {
102
+ definitionFor(config, target.pane);
103
+ if (index > 0) {
104
+ assertCanOpen(config, target.pane, stack[index - 1]);
105
+ }
106
+ stack.push(
107
+ entryFromTarget(target, index, seedOffset + index + 1, stack)
108
+ );
109
+ });
110
+ return Object.freeze(stack);
111
+ }
112
+ function freezeState(stack, revision) {
113
+ return Object.freeze({
114
+ stack: Object.freeze([...stack]),
115
+ revision
116
+ });
117
+ }
118
+ function validateVisiblePanes(stack, selected) {
119
+ const indexes = selected.map(
120
+ (selectedEntry) => stack.findIndex((entry) => entry.key === selectedEntry.key)
121
+ );
122
+ if (indexes.some((index) => index === -1)) {
123
+ throw new Error("selectVisiblePanes returned an entry outside the stack.");
124
+ }
125
+ if (new Set(indexes).size !== indexes.length) {
126
+ throw new Error("selectVisiblePanes returned duplicate entries.");
127
+ }
128
+ if (indexes.some(
129
+ (index, position) => position > 0 && index <= indexes[position - 1]
130
+ )) {
131
+ throw new Error("selectVisiblePanes must preserve stack order.");
132
+ }
133
+ if (stack.length > 0 && !indexes.includes(stack.length - 1)) {
134
+ throw new Error("selectVisiblePanes must include the active pane.");
135
+ }
136
+ return Object.freeze(indexes.map((index) => stack[index]));
137
+ }
138
+ function snapshotFromResolvedConfig(config, state) {
139
+ const activePane = state.stack.at(-1);
140
+ const activeDefinition = activePane ? definitionFor(config, activePane.pane) : void 0;
141
+ const selected = config.selectVisiblePanes ? config.selectVisiblePanes(state.stack, {
142
+ activeDefinition,
143
+ definitions: config.panes
144
+ }) : state.stack.slice(
145
+ -(activeDefinition?.display?.maxVisible ?? config.maxVisible)
146
+ );
147
+ const visiblePanes = validateVisiblePanes(state.stack, selected);
148
+ return Object.freeze({
149
+ stack: state.stack,
150
+ revision: state.revision,
151
+ visiblePanes,
152
+ activePane,
153
+ canGoBack: state.stack.length > config.minimumDepth
154
+ });
155
+ }
156
+ function transitionWithResolvedConfig(config, state, event) {
157
+ const nextRevision = state.revision + 1;
158
+ switch (event.type) {
159
+ case "navigate": {
160
+ definitionFor(config, event.target.pane);
161
+ assertCanOpen(config, event.target.pane, state.stack.at(-1));
162
+ const added = entryFromTarget(
163
+ event.target,
164
+ state.stack.length,
165
+ nextRevision,
166
+ state.stack
167
+ );
168
+ const nextState = freezeState([...state.stack, added], nextRevision);
169
+ return {
170
+ state: nextState,
171
+ change: Object.freeze({ type: "navigate", added })
172
+ };
173
+ }
174
+ case "back": {
175
+ const steps = event.steps ?? 1;
176
+ assertPositiveInteger(steps, "back steps");
177
+ const removeCount = Math.min(
178
+ steps,
179
+ Math.max(0, state.stack.length - config.minimumDepth)
180
+ );
181
+ if (removeCount === 0) {
182
+ return { state, change: void 0 };
183
+ }
184
+ const removed = Object.freeze(state.stack.slice(-removeCount));
185
+ const nextState = freezeState(
186
+ state.stack.slice(0, -removeCount),
187
+ nextRevision
188
+ );
189
+ return {
190
+ state: nextState,
191
+ change: Object.freeze({ type: "back", removed })
192
+ };
193
+ }
194
+ case "back-to": {
195
+ let index = -1;
196
+ if (event.target.key !== void 0) {
197
+ index = state.stack.findIndex(
198
+ (entry) => entry.key === event.target.key
199
+ );
200
+ } else {
201
+ for (let cursor = state.stack.length - 1; cursor >= 0; cursor -= 1) {
202
+ if (state.stack[cursor]?.pane === event.target.pane) {
203
+ index = cursor;
204
+ break;
205
+ }
206
+ }
207
+ }
208
+ if (index === -1) {
209
+ const description = event.target.key !== void 0 ? `key "${event.target.key}"` : `pane "${event.target.pane}"`;
210
+ throw new Error(
211
+ `Cannot go back to ${description}; it is not in the stack.`
212
+ );
213
+ }
214
+ if (index + 1 < config.minimumDepth) {
215
+ throw new Error("Cannot go back below minimumDepth.");
216
+ }
217
+ if (index === state.stack.length - 1) {
218
+ return { state, change: void 0 };
219
+ }
220
+ const removed = Object.freeze(state.stack.slice(index + 1));
221
+ const nextState = freezeState(
222
+ state.stack.slice(0, index + 1),
223
+ nextRevision
224
+ );
225
+ return {
226
+ state: nextState,
227
+ change: Object.freeze({ type: "back-to", removed })
228
+ };
229
+ }
230
+ case "replace": {
231
+ if (state.stack.length === 0) {
232
+ throw new Error("Cannot replace a pane in an empty stack.");
233
+ }
234
+ definitionFor(config, event.target.pane);
235
+ const parent = state.stack.at(-2);
236
+ assertCanOpen(config, event.target.pane, parent);
237
+ const removed = state.stack.at(-1);
238
+ const parentStack = state.stack.slice(0, -1);
239
+ const added = entryFromTarget(
240
+ event.target,
241
+ state.stack.length - 1,
242
+ nextRevision,
243
+ parentStack
244
+ );
245
+ const nextState = freezeState([...parentStack, added], nextRevision);
246
+ return {
247
+ state: nextState,
248
+ change: Object.freeze({ type: "replace", added, removed })
249
+ };
250
+ }
251
+ case "reset": {
252
+ const targets = event.stack ?? config.initialStack;
253
+ if (targets.length < config.minimumDepth) {
254
+ throw new Error("Reset stack cannot be smaller than minimumDepth.");
255
+ }
256
+ const added = buildStack(config, targets, nextRevision);
257
+ const removed = Object.freeze([...state.stack]);
258
+ if (added.length === state.stack.length && added.every((entry, index) => {
259
+ const current = state.stack[index];
260
+ return current?.key === entry.key && current.pane === entry.pane && current.params === entry.params && current.data === entry.data;
261
+ })) {
262
+ return { state, change: void 0 };
263
+ }
264
+ const nextState = freezeState(added, nextRevision);
265
+ return {
266
+ state: nextState,
267
+ change: Object.freeze({ type: "reset", added, removed })
268
+ };
269
+ }
270
+ }
271
+ }
272
+ function definePaneConfig(config) {
273
+ return config;
274
+ }
275
+ function createPaneState(config) {
276
+ const resolved = resolveConfig(config);
277
+ const stack = buildStack(resolved, resolved.initialStack, 0);
278
+ return freezeState(stack, 0);
279
+ }
280
+ function transitionPaneState(config, state, event) {
281
+ return transitionWithResolvedConfig(resolveConfig(config), state, event);
282
+ }
283
+ function createPaneSnapshot(config, state) {
284
+ return snapshotFromResolvedConfig(resolveConfig(config), state);
285
+ }
286
+ var internal = {
287
+ resolveConfig,
288
+ snapshotFromResolvedConfig,
289
+ transitionWithResolvedConfig
290
+ };
291
+
292
+ // src/manager.ts
293
+ function createPaneManager(config) {
294
+ const resolved = internal.resolveConfig(config);
295
+ let state = createPaneState(config);
296
+ let snapshot = internal.snapshotFromResolvedConfig(resolved, state);
297
+ const listeners = /* @__PURE__ */ new Set();
298
+ const dispatch = (event) => {
299
+ const transition = internal.transitionWithResolvedConfig(
300
+ resolved,
301
+ state,
302
+ event
303
+ );
304
+ if (transition.change === void 0) {
305
+ return snapshot;
306
+ }
307
+ const nextSnapshot = internal.snapshotFromResolvedConfig(
308
+ resolved,
309
+ transition.state
310
+ );
311
+ state = transition.state;
312
+ snapshot = nextSnapshot;
313
+ for (const listener of [...listeners]) {
314
+ listener(snapshot, transition.change);
315
+ }
316
+ return snapshot;
317
+ };
318
+ return {
319
+ getSnapshot() {
320
+ return snapshot;
321
+ },
322
+ getDefinition(pane) {
323
+ if (!Object.prototype.hasOwnProperty.call(resolved.panes, pane)) {
324
+ throw new Error(`Unknown pane "${pane}".`);
325
+ }
326
+ return resolved.panes[pane];
327
+ },
328
+ navigate(target) {
329
+ return dispatch({ type: "navigate", target });
330
+ },
331
+ back(options = {}) {
332
+ return dispatch(
333
+ options.steps === void 0 ? { type: "back" } : { type: "back", steps: options.steps }
334
+ );
335
+ },
336
+ backTo(target) {
337
+ return dispatch({ type: "back-to", target });
338
+ },
339
+ replace(target) {
340
+ return dispatch({ type: "replace", target });
341
+ },
342
+ reset(stack) {
343
+ return dispatch(
344
+ stack === void 0 ? { type: "reset" } : { type: "reset", stack }
345
+ );
346
+ },
347
+ canNavigate(target) {
348
+ try {
349
+ internal.transitionWithResolvedConfig(resolved, state, {
350
+ type: "navigate",
351
+ target
352
+ });
353
+ return true;
354
+ } catch {
355
+ return false;
356
+ }
357
+ },
358
+ dispatch,
359
+ subscribe(listener) {
360
+ listeners.add(listener);
361
+ return () => {
362
+ listeners.delete(listener);
363
+ };
364
+ }
365
+ };
366
+ }
367
+ export {
368
+ createPaneManager,
369
+ createPaneSnapshot,
370
+ createPaneState,
371
+ definePaneConfig,
372
+ transitionPaneState
373
+ };
package/dist/react.cjs ADDED
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/react.ts
21
+ var react_exports = {};
22
+ __export(react_exports, {
23
+ usePaneSnapshot: () => usePaneSnapshot,
24
+ useVisiblePanes: () => useVisiblePanes
25
+ });
26
+ module.exports = __toCommonJS(react_exports);
27
+ var import_react = require("react");
28
+ function usePaneSnapshot(manager) {
29
+ return (0, import_react.useSyncExternalStore)(
30
+ manager.subscribe,
31
+ manager.getSnapshot,
32
+ manager.getSnapshot
33
+ );
34
+ }
35
+ function useVisiblePanes(manager) {
36
+ return usePaneSnapshot(manager).visiblePanes;
37
+ }
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ usePaneSnapshot,
41
+ useVisiblePanes
42
+ });
@@ -0,0 +1,11 @@
1
+ import { P as PaneSchema, f as PaneManager, c as PaneSnapshot, m as PaneEntry } from './types-DW8hgJuJ.cjs';
2
+
3
+ /**
4
+ * Subscribe a React component to a pane manager and return its current
5
+ * immutable snapshot.
6
+ */
7
+ declare function usePaneSnapshot<Schema extends PaneSchema>(manager: PaneManager<Schema>): PaneSnapshot<Schema>;
8
+ /** Return the pane entries currently selected by the display policy. */
9
+ declare function useVisiblePanes<Schema extends PaneSchema>(manager: PaneManager<Schema>): readonly PaneEntry<Schema>[];
10
+
11
+ export { usePaneSnapshot, useVisiblePanes };
@@ -0,0 +1,11 @@
1
+ import { P as PaneSchema, f as PaneManager, c as PaneSnapshot, m as PaneEntry } from './types-DW8hgJuJ.js';
2
+
3
+ /**
4
+ * Subscribe a React component to a pane manager and return its current
5
+ * immutable snapshot.
6
+ */
7
+ declare function usePaneSnapshot<Schema extends PaneSchema>(manager: PaneManager<Schema>): PaneSnapshot<Schema>;
8
+ /** Return the pane entries currently selected by the display policy. */
9
+ declare function useVisiblePanes<Schema extends PaneSchema>(manager: PaneManager<Schema>): readonly PaneEntry<Schema>[];
10
+
11
+ export { usePaneSnapshot, useVisiblePanes };
package/dist/react.js ADDED
@@ -0,0 +1,16 @@
1
+ // src/react.ts
2
+ import { useSyncExternalStore } from "react";
3
+ function usePaneSnapshot(manager) {
4
+ return useSyncExternalStore(
5
+ manager.subscribe,
6
+ manager.getSnapshot,
7
+ manager.getSnapshot
8
+ );
9
+ }
10
+ function useVisiblePanes(manager) {
11
+ return usePaneSnapshot(manager).visiblePanes;
12
+ }
13
+ export {
14
+ usePaneSnapshot,
15
+ useVisiblePanes
16
+ };
@@ -0,0 +1,131 @@
1
+ type PaneSchema = Record<string, unknown>;
2
+ type PaneName<Schema extends PaneSchema> = Extract<keyof Schema, string>;
3
+ type Field<Definition, Name extends PropertyKey, Fallback> = Definition extends Record<Name, infer Value> ? Value : Fallback;
4
+ type PaneParams<Schema extends PaneSchema, Name extends PaneName<Schema>> = Field<Schema[Name], "params", undefined>;
5
+ type PaneData<Schema extends PaneSchema, Name extends PaneName<Schema>> = Field<Schema[Name], "data", undefined>;
6
+ type PaneMeta<Schema extends PaneSchema, Name extends PaneName<Schema>> = Field<Schema[Name], "meta", unknown>;
7
+ type InputProperty<Name extends PropertyKey, Value> = undefined extends Value ? {
8
+ [Key in Name]?: Value;
9
+ } : {
10
+ [Key in Name]: Value;
11
+ };
12
+ type PaneTargetFor<Schema extends PaneSchema, Name extends PaneName<Schema>> = {
13
+ readonly pane: Name;
14
+ readonly key?: string;
15
+ } & InputProperty<"params", PaneParams<Schema, Name>> & InputProperty<"data", PaneData<Schema, Name>>;
16
+ type PaneTarget<Schema extends PaneSchema> = {
17
+ [Name in PaneName<Schema>]: PaneTargetFor<Schema, Name>;
18
+ }[PaneName<Schema>];
19
+ type PaneEntryFor<Schema extends PaneSchema, Name extends PaneName<Schema>> = Readonly<{
20
+ key: string;
21
+ pane: Name;
22
+ params: PaneParams<Schema, Name>;
23
+ data: PaneData<Schema, Name>;
24
+ /** Zero-based position in the stack. */
25
+ depth: number;
26
+ }>;
27
+ type PaneEntry<Schema extends PaneSchema> = {
28
+ [Name in PaneName<Schema>]: PaneEntryFor<Schema, Name>;
29
+ }[PaneName<Schema>];
30
+ type PaneDefinition<Schema extends PaneSchema, Name extends PaneName<Schema>> = Readonly<{
31
+ canOpenFrom?: readonly PaneName<Schema>[];
32
+ display?: Readonly<{
33
+ maxVisible?: number;
34
+ }>;
35
+ meta?: PaneMeta<Schema, Name>;
36
+ }>;
37
+ type PaneDefinitions<Schema extends PaneSchema> = {
38
+ readonly [Name in PaneName<Schema>]: PaneDefinition<Schema, Name>;
39
+ };
40
+ interface PaneDisplayContext<Schema extends PaneSchema> {
41
+ readonly activeDefinition: PaneDefinition<Schema, PaneName<Schema>> | undefined;
42
+ readonly definitions: PaneDefinitions<Schema>;
43
+ }
44
+ interface PaneManagerConfig<Schema extends PaneSchema> {
45
+ readonly panes: PaneDefinitions<Schema>;
46
+ readonly initialStack?: readonly PaneTarget<Schema>[];
47
+ readonly display?: Readonly<{
48
+ maxVisible?: number;
49
+ }>;
50
+ /**
51
+ * Smallest stack depth reachable with back navigation. Defaults to one when
52
+ * an initial stack exists, and zero otherwise.
53
+ */
54
+ readonly minimumDepth?: number;
55
+ readonly selectVisiblePanes?: (stack: readonly PaneEntry<Schema>[], context: PaneDisplayContext<Schema>) => readonly PaneEntry<Schema>[];
56
+ }
57
+ interface DefinedPaneConfig<Schema extends PaneSchema> extends PaneManagerConfig<Schema> {
58
+ /** Carries the schema through inference without creating a runtime field. */
59
+ readonly __schema?: Schema;
60
+ }
61
+ interface PaneState<Schema extends PaneSchema> {
62
+ readonly stack: readonly PaneEntry<Schema>[];
63
+ readonly revision: number;
64
+ }
65
+ interface PaneSnapshot<Schema extends PaneSchema> extends PaneState<Schema> {
66
+ readonly visiblePanes: readonly PaneEntry<Schema>[];
67
+ readonly activePane: PaneEntry<Schema> | undefined;
68
+ readonly canGoBack: boolean;
69
+ }
70
+ type PaneBackToTarget<Schema extends PaneSchema> = Readonly<{
71
+ key: string;
72
+ pane?: never;
73
+ }> | Readonly<{
74
+ pane: PaneName<Schema>;
75
+ key?: never;
76
+ }>;
77
+ type PaneEvent<Schema extends PaneSchema> = Readonly<{
78
+ type: "navigate";
79
+ target: PaneTarget<Schema>;
80
+ }> | Readonly<{
81
+ type: "back";
82
+ steps?: number;
83
+ }> | Readonly<{
84
+ type: "back-to";
85
+ target: PaneBackToTarget<Schema>;
86
+ }> | Readonly<{
87
+ type: "replace";
88
+ target: PaneTarget<Schema>;
89
+ }> | Readonly<{
90
+ type: "reset";
91
+ stack?: readonly PaneTarget<Schema>[];
92
+ }>;
93
+ type PaneChange<Schema extends PaneSchema> = Readonly<{
94
+ type: "navigate";
95
+ added: PaneEntry<Schema>;
96
+ }> | Readonly<{
97
+ type: "back";
98
+ removed: readonly PaneEntry<Schema>[];
99
+ }> | Readonly<{
100
+ type: "back-to";
101
+ removed: readonly PaneEntry<Schema>[];
102
+ }> | Readonly<{
103
+ type: "replace";
104
+ added: PaneEntry<Schema>;
105
+ removed: PaneEntry<Schema>;
106
+ }> | Readonly<{
107
+ type: "reset";
108
+ added: readonly PaneEntry<Schema>[];
109
+ removed: readonly PaneEntry<Schema>[];
110
+ }>;
111
+ interface PaneTransition<Schema extends PaneSchema> {
112
+ readonly state: PaneState<Schema>;
113
+ readonly change: PaneChange<Schema> | undefined;
114
+ }
115
+ type PaneListener<Schema extends PaneSchema> = (snapshot: PaneSnapshot<Schema>, change: PaneChange<Schema>) => void;
116
+ interface PaneManager<Schema extends PaneSchema> {
117
+ getSnapshot(): PaneSnapshot<Schema>;
118
+ getDefinition<Name extends PaneName<Schema>>(pane: Name): PaneDefinition<Schema, Name>;
119
+ navigate<Name extends PaneName<Schema>>(target: PaneTargetFor<Schema, Name>): PaneSnapshot<Schema>;
120
+ back(options?: Readonly<{
121
+ steps?: number;
122
+ }>): PaneSnapshot<Schema>;
123
+ backTo(target: PaneBackToTarget<Schema>): PaneSnapshot<Schema>;
124
+ replace<Name extends PaneName<Schema>>(target: PaneTargetFor<Schema, Name>): PaneSnapshot<Schema>;
125
+ reset(stack?: readonly PaneTarget<Schema>[]): PaneSnapshot<Schema>;
126
+ canNavigate<Name extends PaneName<Schema>>(target: PaneTargetFor<Schema, Name>): boolean;
127
+ dispatch(event: PaneEvent<Schema>): PaneSnapshot<Schema>;
128
+ subscribe(listener: PaneListener<Schema>): () => void;
129
+ }
130
+
131
+ export type { DefinedPaneConfig as D, PaneSchema as P, PaneManagerConfig as a, PaneState as b, PaneSnapshot as c, PaneEvent as d, PaneTransition as e, PaneManager as f, PaneBackToTarget as g, PaneChange as h, PaneData as i, PaneDefinition as j, PaneDefinitions as k, PaneDisplayContext as l, PaneEntry as m, PaneEntryFor as n, PaneListener as o, PaneMeta as p, PaneName as q, PaneParams as r, PaneTarget as s, PaneTargetFor as t };