@stonecrop/stonecrop 0.4.37 → 0.6.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/README.md +92 -3
- package/dist/src/composable.d.ts +74 -8
- package/dist/src/composable.d.ts.map +1 -1
- package/dist/src/composable.js +348 -0
- package/dist/src/composables/operation-log.d.ts +136 -0
- package/dist/src/composables/operation-log.d.ts.map +1 -0
- package/dist/src/composables/operation-log.js +221 -0
- package/dist/src/doctype.d.ts +9 -1
- package/dist/src/doctype.d.ts.map +1 -1
- package/dist/{doctype.js → src/doctype.js} +9 -3
- package/dist/src/field-triggers.d.ts +178 -0
- package/dist/src/field-triggers.d.ts.map +1 -0
- package/dist/src/field-triggers.js +564 -0
- package/dist/src/index.d.ts +12 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +18 -0
- package/dist/src/plugins/index.d.ts +11 -13
- package/dist/src/plugins/index.d.ts.map +1 -1
- package/dist/src/plugins/index.js +90 -0
- package/dist/src/registry.d.ts +9 -3
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/{registry.js → src/registry.js} +14 -1
- package/dist/src/stonecrop.d.ts +350 -114
- package/dist/src/stonecrop.d.ts.map +1 -1
- package/dist/src/stonecrop.js +251 -0
- package/dist/src/stores/hst.d.ts +157 -0
- package/dist/src/stores/hst.d.ts.map +1 -0
- package/dist/src/stores/hst.js +483 -0
- package/dist/src/stores/index.d.ts +5 -1
- package/dist/src/stores/index.d.ts.map +1 -1
- package/dist/{stores → src/stores}/index.js +4 -1
- package/dist/src/stores/operation-log.d.ts +268 -0
- package/dist/src/stores/operation-log.d.ts.map +1 -0
- package/dist/src/stores/operation-log.js +571 -0
- package/dist/src/types/field-triggers.d.ts +186 -0
- package/dist/src/types/field-triggers.d.ts.map +1 -0
- package/dist/src/types/field-triggers.js +4 -0
- package/dist/src/types/index.d.ts +13 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +4 -0
- package/dist/src/types/operation-log.d.ts +165 -0
- package/dist/src/types/operation-log.d.ts.map +1 -0
- package/dist/src/types/registry.d.ts +11 -0
- package/dist/src/types/registry.d.ts.map +1 -0
- package/dist/src/types/registry.js +0 -0
- package/dist/stonecrop.d.ts +1555 -159
- package/dist/stonecrop.js +1974 -7028
- package/dist/stonecrop.js.map +1 -1
- package/dist/stonecrop.umd.cjs +4 -8
- package/dist/stonecrop.umd.cjs.map +1 -1
- package/dist/tests/setup.d.ts +5 -0
- package/dist/tests/setup.d.ts.map +1 -0
- package/dist/tests/setup.js +15 -0
- package/package.json +6 -5
- package/src/composable.ts +481 -31
- package/src/composables/operation-log.ts +254 -0
- package/src/doctype.ts +9 -3
- package/src/field-triggers.ts +671 -0
- package/src/index.ts +50 -4
- package/src/plugins/index.ts +70 -22
- package/src/registry.ts +18 -3
- package/src/stonecrop.ts +246 -155
- package/src/stores/hst.ts +703 -0
- package/src/stores/index.ts +6 -1
- package/src/stores/operation-log.ts +671 -0
- package/src/types/field-triggers.ts +201 -0
- package/src/types/index.ts +17 -6
- package/src/types/operation-log.ts +205 -0
- package/src/types/registry.ts +10 -0
- package/dist/composable.js +0 -50
- package/dist/index.js +0 -6
- package/dist/plugins/index.js +0 -49
- package/dist/src/stores/data.d.ts +0 -11
- package/dist/src/stores/data.d.ts.map +0 -1
- package/dist/stores/data.js +0 -7
- package/src/stores/data.ts +0 -8
- /package/dist/{exceptions.js → src/exceptions.js} +0 -0
- /package/dist/{types/index.js → src/types/operation-log.js} +0 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { createHST } from './stores/hst';
|
|
2
|
+
import { useOperationLogStore } from './stores/operation-log';
|
|
3
|
+
/**
|
|
4
|
+
* Main Stonecrop class with HST integration and built-in Operation Log
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export class Stonecrop {
|
|
8
|
+
hstStore;
|
|
9
|
+
_operationLogStore;
|
|
10
|
+
_operationLogConfig;
|
|
11
|
+
/** The registry instance containing all doctype definitions */
|
|
12
|
+
registry;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new Stonecrop instance with HST integration
|
|
15
|
+
* @param registry - The Registry instance containing doctype definitions
|
|
16
|
+
* @param operationLogConfig - Optional configuration for the operation log
|
|
17
|
+
*/
|
|
18
|
+
constructor(registry, operationLogConfig) {
|
|
19
|
+
this.registry = registry;
|
|
20
|
+
// Store config for lazy initialization
|
|
21
|
+
this._operationLogConfig = operationLogConfig;
|
|
22
|
+
// Initialize HST store with auto-sync to Registry
|
|
23
|
+
this.initializeHSTStore();
|
|
24
|
+
this.setupRegistrySync();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the operation log store (lazy initialization)
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
getOperationLogStore() {
|
|
31
|
+
if (!this._operationLogStore) {
|
|
32
|
+
this._operationLogStore = useOperationLogStore();
|
|
33
|
+
if (this._operationLogConfig) {
|
|
34
|
+
this._operationLogStore.configure(this._operationLogConfig);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return this._operationLogStore;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Initialize the HST store structure
|
|
41
|
+
*/
|
|
42
|
+
initializeHSTStore() {
|
|
43
|
+
const initialStoreStructure = {};
|
|
44
|
+
// Auto-populate from existing Registry doctypes
|
|
45
|
+
Object.keys(this.registry.registry).forEach(doctypeSlug => {
|
|
46
|
+
initialStoreStructure[doctypeSlug] = {};
|
|
47
|
+
});
|
|
48
|
+
this.hstStore = createHST(initialStoreStructure, 'StonecropStore');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Setup automatic sync with Registry when doctypes are added
|
|
52
|
+
*/
|
|
53
|
+
setupRegistrySync() {
|
|
54
|
+
// Extend Registry.addDoctype to auto-create HST store sections
|
|
55
|
+
const originalAddDoctype = this.registry.addDoctype.bind(this.registry);
|
|
56
|
+
this.registry.addDoctype = (doctype) => {
|
|
57
|
+
// Call original method
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
59
|
+
originalAddDoctype(doctype);
|
|
60
|
+
// Auto-create HST store section for new doctype
|
|
61
|
+
if (!this.hstStore.has(doctype.slug)) {
|
|
62
|
+
this.hstStore.set(doctype.slug, {});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get records hash for a doctype
|
|
68
|
+
* @param doctype - The doctype to get records for
|
|
69
|
+
* @returns HST node containing records hash
|
|
70
|
+
*/
|
|
71
|
+
records(doctype) {
|
|
72
|
+
const slug = typeof doctype === 'string' ? doctype : doctype.slug;
|
|
73
|
+
this.ensureDoctypeExists(slug);
|
|
74
|
+
return this.hstStore.getNode(slug);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Add a record to the store
|
|
78
|
+
* @param doctype - The doctype
|
|
79
|
+
* @param recordId - The record ID
|
|
80
|
+
* @param recordData - The record data
|
|
81
|
+
*/
|
|
82
|
+
addRecord(doctype, recordId, recordData) {
|
|
83
|
+
const slug = typeof doctype === 'string' ? doctype : doctype.slug;
|
|
84
|
+
this.ensureDoctypeExists(slug);
|
|
85
|
+
// Store raw record data - let HST handle wrapping with proper hierarchy
|
|
86
|
+
this.hstStore.set(`${slug}.${recordId}`, recordData);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Get a specific record
|
|
90
|
+
* @param doctype - The doctype
|
|
91
|
+
* @param recordId - The record ID
|
|
92
|
+
* @returns HST node for the record or undefined
|
|
93
|
+
*/
|
|
94
|
+
getRecordById(doctype, recordId) {
|
|
95
|
+
const slug = typeof doctype === 'string' ? doctype : doctype.slug;
|
|
96
|
+
this.ensureDoctypeExists(slug);
|
|
97
|
+
// First check if the record exists
|
|
98
|
+
const recordExists = this.hstStore.has(`${slug}.${recordId}`);
|
|
99
|
+
if (!recordExists) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
// Check if the actual value is undefined (i.e., record was removed)
|
|
103
|
+
const recordValue = this.hstStore.get(`${slug}.${recordId}`);
|
|
104
|
+
if (recordValue === undefined) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
// Use getNode to get the properly wrapped HST node with correct parent relationships
|
|
108
|
+
return this.hstStore.getNode(`${slug}.${recordId}`);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Remove a record from the store
|
|
112
|
+
* @param doctype - The doctype
|
|
113
|
+
* @param recordId - The record ID
|
|
114
|
+
*/
|
|
115
|
+
removeRecord(doctype, recordId) {
|
|
116
|
+
const slug = typeof doctype === 'string' ? doctype : doctype.slug;
|
|
117
|
+
this.ensureDoctypeExists(slug);
|
|
118
|
+
// Remove the specific record directly by setting to undefined
|
|
119
|
+
if (this.hstStore.has(`${slug}.${recordId}`)) {
|
|
120
|
+
this.hstStore.set(`${slug}.${recordId}`, undefined);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Get all record IDs for a doctype
|
|
125
|
+
* @param doctype - The doctype
|
|
126
|
+
* @returns Array of record IDs
|
|
127
|
+
*/
|
|
128
|
+
getRecordIds(doctype) {
|
|
129
|
+
const slug = typeof doctype === 'string' ? doctype : doctype.slug;
|
|
130
|
+
this.ensureDoctypeExists(slug);
|
|
131
|
+
const doctypeNode = this.hstStore.get(slug);
|
|
132
|
+
if (!doctypeNode || typeof doctypeNode !== 'object') {
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
135
|
+
return Object.keys(doctypeNode).filter(key => doctypeNode[key] !== undefined);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Clear all records for a doctype
|
|
139
|
+
* @param doctype - The doctype
|
|
140
|
+
*/
|
|
141
|
+
clearRecords(doctype) {
|
|
142
|
+
const slug = typeof doctype === 'string' ? doctype : doctype.slug;
|
|
143
|
+
this.ensureDoctypeExists(slug);
|
|
144
|
+
// Get all record IDs and remove them
|
|
145
|
+
const recordIds = this.getRecordIds(slug);
|
|
146
|
+
recordIds.forEach(recordId => {
|
|
147
|
+
this.hstStore.set(`${slug}.${recordId}`, undefined);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Setup method for doctype initialization
|
|
152
|
+
* @param doctype - The doctype to setup
|
|
153
|
+
*/
|
|
154
|
+
setup(doctype) {
|
|
155
|
+
// Ensure doctype exists in store
|
|
156
|
+
this.ensureDoctypeExists(doctype.slug);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Run action on doctype
|
|
160
|
+
* Executes the action and logs it to the operation log for audit tracking
|
|
161
|
+
* @param doctype - The doctype
|
|
162
|
+
* @param action - The action to run
|
|
163
|
+
* @param args - Action arguments (typically record IDs)
|
|
164
|
+
*/
|
|
165
|
+
runAction(doctype, action, args) {
|
|
166
|
+
const registry = this.registry.registry[doctype.slug];
|
|
167
|
+
const actions = registry?.actions?.get(action);
|
|
168
|
+
const recordIds = Array.isArray(args) ? args.filter((arg) => typeof arg === 'string') : undefined;
|
|
169
|
+
// Log action execution start
|
|
170
|
+
const opLogStore = this.getOperationLogStore();
|
|
171
|
+
let actionResult = 'success';
|
|
172
|
+
let actionError;
|
|
173
|
+
try {
|
|
174
|
+
// Execute action functions
|
|
175
|
+
if (actions && actions.length > 0) {
|
|
176
|
+
actions.forEach(actionStr => {
|
|
177
|
+
try {
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
179
|
+
const actionFn = new Function('args', actionStr);
|
|
180
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
181
|
+
actionFn(args);
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
actionResult = 'failure';
|
|
185
|
+
actionError = error instanceof Error ? error.message : 'Unknown error';
|
|
186
|
+
throw error;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
// Error already set in inner catch
|
|
193
|
+
}
|
|
194
|
+
finally {
|
|
195
|
+
// Log the action execution to operation log
|
|
196
|
+
opLogStore.logAction(doctype.doctype, action, recordIds, actionResult, actionError);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Get records from server (maintains compatibility)
|
|
201
|
+
* @param doctype - The doctype
|
|
202
|
+
*/
|
|
203
|
+
async getRecords(doctype) {
|
|
204
|
+
const response = await fetch(`/${doctype.slug}`);
|
|
205
|
+
const records = await response.json();
|
|
206
|
+
// Store each record in HST
|
|
207
|
+
records.forEach((record) => {
|
|
208
|
+
if (record.id) {
|
|
209
|
+
this.addRecord(doctype, record.id, record);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Get single record from server (maintains compatibility)
|
|
215
|
+
* @param doctype - The doctype
|
|
216
|
+
* @param recordId - The record ID
|
|
217
|
+
*/
|
|
218
|
+
async getRecord(doctype, recordId) {
|
|
219
|
+
const response = await fetch(`/${doctype.slug}/${recordId}`);
|
|
220
|
+
const record = await response.json();
|
|
221
|
+
// Store record
|
|
222
|
+
this.addRecord(doctype, recordId, record);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Ensure doctype section exists in HST store
|
|
226
|
+
* @param slug - The doctype slug
|
|
227
|
+
*/
|
|
228
|
+
ensureDoctypeExists(slug) {
|
|
229
|
+
if (!this.hstStore.has(slug)) {
|
|
230
|
+
this.hstStore.set(slug, {});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Get doctype metadata from the registry
|
|
235
|
+
* @param context - The route context
|
|
236
|
+
* @returns The doctype metadata
|
|
237
|
+
*/
|
|
238
|
+
async getMeta(context) {
|
|
239
|
+
if (!this.registry.getMeta) {
|
|
240
|
+
throw new Error('No getMeta function provided to Registry');
|
|
241
|
+
}
|
|
242
|
+
return await this.registry.getMeta(context);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Get the root HST store node for advanced usage
|
|
246
|
+
* @returns Root HST node
|
|
247
|
+
*/
|
|
248
|
+
getStore() {
|
|
249
|
+
return this.hstStore;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core HST Interface - enhanced with tree navigation
|
|
3
|
+
* Provides a hierarchical state tree interface for navigating and manipulating nested data structures.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
interface HSTNode {
|
|
8
|
+
/**
|
|
9
|
+
* Gets a value at the specified path
|
|
10
|
+
* @param path - The dot-separated path to the value
|
|
11
|
+
* @returns The value at the specified path
|
|
12
|
+
*/
|
|
13
|
+
get(path: string): any;
|
|
14
|
+
/**
|
|
15
|
+
* Sets a value at the specified path
|
|
16
|
+
* @param path - The dot-separated path where to set the value
|
|
17
|
+
* @param value - The value to set
|
|
18
|
+
* @param source - Optional source of the operation (user, system, sync, undo, redo)
|
|
19
|
+
*/
|
|
20
|
+
set(path: string, value: any, source?: 'user' | 'system' | 'sync' | 'undo' | 'redo'): void;
|
|
21
|
+
/**
|
|
22
|
+
* Checks if a value exists at the specified path
|
|
23
|
+
* @param path - The dot-separated path to check
|
|
24
|
+
* @returns True if the path exists, false otherwise
|
|
25
|
+
*/
|
|
26
|
+
has(path: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the parent node in the tree hierarchy
|
|
29
|
+
* @returns The parent HSTNode or null if this is the root
|
|
30
|
+
*/
|
|
31
|
+
getParent(): HSTNode | null;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the root node of the tree
|
|
34
|
+
* @returns The root HSTNode
|
|
35
|
+
*/
|
|
36
|
+
getRoot(): HSTNode;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the full path from root to this node
|
|
39
|
+
* @returns The dot-separated path string
|
|
40
|
+
*/
|
|
41
|
+
getPath(): string;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the depth level of this node in the tree
|
|
44
|
+
* @returns The depth as a number (0 for root)
|
|
45
|
+
*/
|
|
46
|
+
getDepth(): number;
|
|
47
|
+
/**
|
|
48
|
+
* Gets an array of path segments from root to this node
|
|
49
|
+
* @returns Array of path segments representing breadcrumbs
|
|
50
|
+
*/
|
|
51
|
+
getBreadcrumbs(): string[];
|
|
52
|
+
/**
|
|
53
|
+
* Gets a child node at the specified relative path
|
|
54
|
+
* @param path - The relative path to the child node
|
|
55
|
+
* @returns The child HSTNode
|
|
56
|
+
*/
|
|
57
|
+
getNode(path: string): HSTNode;
|
|
58
|
+
/**
|
|
59
|
+
* Trigger an XState transition with optional context data
|
|
60
|
+
* @param transition - The transition name (should be uppercase per convention)
|
|
61
|
+
* @param context - Optional additional FSM context data
|
|
62
|
+
* @returns Promise resolving to the transition execution results
|
|
63
|
+
*/
|
|
64
|
+
triggerTransition(transition: string, context?: {
|
|
65
|
+
currentState?: string;
|
|
66
|
+
targetState?: string;
|
|
67
|
+
fsmContext?: Record<string, any>;
|
|
68
|
+
}): Promise<any>;
|
|
69
|
+
}
|
|
70
|
+
interface RegistryGlobal {
|
|
71
|
+
Registry?: {
|
|
72
|
+
_root?: {
|
|
73
|
+
registry: Record<string, any>;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
declare global {
|
|
78
|
+
interface Window extends RegistryGlobal {
|
|
79
|
+
}
|
|
80
|
+
const global: RegistryGlobal | undefined;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Global HST Manager (Singleton)
|
|
84
|
+
* Manages hierarchical state trees and provides access to the global registry.
|
|
85
|
+
*
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
declare class HST {
|
|
89
|
+
private static instance;
|
|
90
|
+
/**
|
|
91
|
+
* Gets the singleton instance of HST
|
|
92
|
+
* @returns The HST singleton instance
|
|
93
|
+
*/
|
|
94
|
+
static getInstance(): HST;
|
|
95
|
+
/**
|
|
96
|
+
* Gets the global registry instance
|
|
97
|
+
* @returns The global registry object or undefined if not found
|
|
98
|
+
*/
|
|
99
|
+
getRegistry(): any;
|
|
100
|
+
/**
|
|
101
|
+
* Helper method to get doctype metadata from the registry
|
|
102
|
+
* @param doctype - The name of the doctype to retrieve metadata for
|
|
103
|
+
* @returns The doctype metadata object or undefined if not found
|
|
104
|
+
*/
|
|
105
|
+
getDoctypeMeta(doctype: string): any;
|
|
106
|
+
}
|
|
107
|
+
declare class HSTProxy implements HSTNode {
|
|
108
|
+
private target;
|
|
109
|
+
private parentPath;
|
|
110
|
+
private rootNode;
|
|
111
|
+
private doctype;
|
|
112
|
+
private parentDoctype?;
|
|
113
|
+
private hst;
|
|
114
|
+
constructor(target: any, doctype: string, parentPath?: string, rootNode?: HSTNode | null, parentDoctype?: string);
|
|
115
|
+
get(path: string): any;
|
|
116
|
+
getNode(path: string): HSTNode;
|
|
117
|
+
set(path: string, value: any, source?: 'user' | 'system' | 'sync' | 'undo' | 'redo'): void;
|
|
118
|
+
has(path: string): boolean;
|
|
119
|
+
getParent(): HSTNode | null;
|
|
120
|
+
getRoot(): HSTNode;
|
|
121
|
+
getPath(): string;
|
|
122
|
+
getDepth(): number;
|
|
123
|
+
getBreadcrumbs(): string[];
|
|
124
|
+
/**
|
|
125
|
+
* Trigger an XState transition with optional context data
|
|
126
|
+
*/
|
|
127
|
+
triggerTransition(transition: string, context?: {
|
|
128
|
+
currentState?: string;
|
|
129
|
+
targetState?: string;
|
|
130
|
+
fsmContext?: Record<string, any>;
|
|
131
|
+
}): Promise<any>;
|
|
132
|
+
private resolvePath;
|
|
133
|
+
private resolveValue;
|
|
134
|
+
private updateValue;
|
|
135
|
+
private getProperty;
|
|
136
|
+
private setProperty;
|
|
137
|
+
private triggerFieldActions;
|
|
138
|
+
private isVueReactive;
|
|
139
|
+
private isPiniaStore;
|
|
140
|
+
private isImmutable;
|
|
141
|
+
private isPrimitive;
|
|
142
|
+
private parsePath;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Factory function for HST creation
|
|
146
|
+
* Creates a new HSTNode proxy for hierarchical state tree navigation.
|
|
147
|
+
*
|
|
148
|
+
* @param target - The target object to wrap with HST functionality
|
|
149
|
+
* @param doctype - The document type identifier
|
|
150
|
+
* @param parentDoctype - Optional parent document type identifier
|
|
151
|
+
* @returns A new HSTNode proxy instance
|
|
152
|
+
*
|
|
153
|
+
* @public
|
|
154
|
+
*/
|
|
155
|
+
declare function createHST(target: any, doctype: string, parentDoctype?: string): HSTNode;
|
|
156
|
+
export { HSTProxy, HST, createHST, type HSTNode };
|
|
157
|
+
//# sourceMappingURL=hst.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hst.d.ts","sourceRoot":"","sources":["../../../src/stores/hst.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,UAAU,OAAO;IAChB;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;IAEtB;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAE1F;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IAE1B;;;OAGG;IACH,SAAS,IAAI,OAAO,GAAG,IAAI,CAAA;IAE3B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAA;IAElB;;;OAGG;IACH,OAAO,IAAI,MAAM,CAAA;IAEjB;;;OAGG;IACH,QAAQ,IAAI,MAAM,CAAA;IAElB;;;OAGG;IACH,cAAc,IAAI,MAAM,EAAE,CAAA;IAE1B;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IAE9B;;;;;OAKG;IACH,iBAAiB,CAChB,UAAU,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