korajs 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.
- package/dist/config.cjs +33 -0
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +39 -0
- package/dist/config.d.ts +39 -0
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -0
- package/dist/index.cjs +470 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +190 -0
- package/dist/index.d.ts +190 -0
- package/dist/index.js +423 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { KoraEventEmitter, SchemaDefinition, SchemaInput, FieldBuilder, InferRecord, InferInsertInput, InferUpdateInput } from '@korajs/core';
|
|
2
|
+
export { CollectionDefinition, ConnectionQuality, Constraint, FieldDescriptor, FieldKindToType, HLCTimestamp, HybridLogicalClock, InferFieldType, InferInsertInput, InferRecord, InferUpdateInput, KoraError, KoraEvent, KoraEventEmitter, KoraEventListener, KoraEventType, MergeStrategy, MergeTrace, Operation, SchemaDefinition, SchemaInput, TypedSchemaDefinition, VersionVector, createOperation, defineSchema, generateUUIDv7, t } from '@korajs/core';
|
|
3
|
+
import * as _korajs_store from '@korajs/store';
|
|
4
|
+
import { QueryBuilder, CollectionAccessor } from '@korajs/store';
|
|
5
|
+
export { CollectionAccessor, CollectionRecord, StorageAdapter, Store, StoreConfig } from '@korajs/store';
|
|
6
|
+
import { SyncStatusInfo, SyncEngine } from '@korajs/sync';
|
|
7
|
+
export { SyncConfig, SyncEngine, SyncState, SyncStatus, SyncStatusInfo, SyncStore, WebSocketTransport } from '@korajs/sync';
|
|
8
|
+
export { MergeEngine, MergeInput, MergeResult } from '@korajs/merge';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Adapter type for local storage.
|
|
12
|
+
* - 'sqlite-wasm': SQLite WASM with OPFS (browser, primary)
|
|
13
|
+
* - 'indexeddb': IndexedDB fallback (browser, when OPFS unavailable)
|
|
14
|
+
* - 'better-sqlite3': Native SQLite (Node.js, server-side, Electron)
|
|
15
|
+
*/
|
|
16
|
+
type AdapterType = 'sqlite-wasm' | 'indexeddb' | 'better-sqlite3';
|
|
17
|
+
/**
|
|
18
|
+
* Store configuration within createApp.
|
|
19
|
+
*/
|
|
20
|
+
interface StoreOptions {
|
|
21
|
+
/** Explicit adapter type. Auto-detected if omitted. */
|
|
22
|
+
adapter?: AdapterType;
|
|
23
|
+
/** Database name. Defaults to 'kora-db'. */
|
|
24
|
+
name?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sync configuration within createApp.
|
|
28
|
+
*/
|
|
29
|
+
interface SyncOptions {
|
|
30
|
+
/** WebSocket or HTTP URL for the sync server */
|
|
31
|
+
url: string;
|
|
32
|
+
/** Transport type. Defaults to 'websocket'. */
|
|
33
|
+
transport?: 'websocket' | 'http';
|
|
34
|
+
/** Auth provider function. Called before each connection attempt. */
|
|
35
|
+
auth?: () => Promise<{
|
|
36
|
+
token: string;
|
|
37
|
+
}>;
|
|
38
|
+
/** Sync scopes per collection. */
|
|
39
|
+
scopes?: Record<string, (ctx: Record<string, unknown>) => Record<string, unknown>>;
|
|
40
|
+
/** Number of operations per batch. Defaults to 100. */
|
|
41
|
+
batchSize?: number;
|
|
42
|
+
/** Schema version of this client. */
|
|
43
|
+
schemaVersion?: number;
|
|
44
|
+
/** Enable auto-reconnection on unexpected disconnect. Defaults to true. */
|
|
45
|
+
autoReconnect?: boolean;
|
|
46
|
+
/** Initial reconnection delay in ms. Defaults to 1000. */
|
|
47
|
+
reconnectInterval?: number;
|
|
48
|
+
/** Maximum reconnection delay in ms. Defaults to 30000. */
|
|
49
|
+
maxReconnectInterval?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Full configuration passed to createApp().
|
|
53
|
+
*/
|
|
54
|
+
interface KoraConfig {
|
|
55
|
+
/** The application schema. Required. */
|
|
56
|
+
schema: SchemaDefinition;
|
|
57
|
+
/** Optional store configuration. */
|
|
58
|
+
store?: StoreOptions;
|
|
59
|
+
/** Optional sync configuration. Enables sync when provided. */
|
|
60
|
+
sync?: SyncOptions;
|
|
61
|
+
/** Enable DevTools instrumentation. Defaults to false. */
|
|
62
|
+
devtools?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Typed configuration passed to createApp() when using a TypedSchemaDefinition.
|
|
66
|
+
*/
|
|
67
|
+
interface TypedKoraConfig<S extends SchemaInput> {
|
|
68
|
+
/** The application schema with preserved type information. Required. */
|
|
69
|
+
schema: SchemaDefinition & {
|
|
70
|
+
readonly __input: S;
|
|
71
|
+
};
|
|
72
|
+
/** Optional store configuration. */
|
|
73
|
+
store?: StoreOptions;
|
|
74
|
+
/** Optional sync configuration. Enables sync when provided. */
|
|
75
|
+
sync?: SyncOptions;
|
|
76
|
+
/** Enable DevTools instrumentation. Defaults to false. */
|
|
77
|
+
devtools?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Controls for the sync subsystem exposed on the KoraApp.
|
|
81
|
+
*/
|
|
82
|
+
interface SyncControl {
|
|
83
|
+
/** Connect to the sync server and start syncing. */
|
|
84
|
+
connect(): Promise<void>;
|
|
85
|
+
/** Disconnect from the sync server. */
|
|
86
|
+
disconnect(): Promise<void>;
|
|
87
|
+
/** Get the current developer-facing sync status. */
|
|
88
|
+
getStatus(): SyncStatusInfo;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The main application object returned by createApp().
|
|
92
|
+
* Collection accessors are defined as dynamic properties via Object.defineProperty.
|
|
93
|
+
*/
|
|
94
|
+
interface KoraApp {
|
|
95
|
+
/** Resolves when the store is open and collections are ready. */
|
|
96
|
+
ready: Promise<void>;
|
|
97
|
+
/** Event emitter for DevTools integration and custom listeners. */
|
|
98
|
+
events: KoraEventEmitter;
|
|
99
|
+
/** Sync control (connect/disconnect/status). Null if sync not configured. */
|
|
100
|
+
sync: SyncControl | null;
|
|
101
|
+
/** Get the underlying Store instance (for advanced use / React integration). */
|
|
102
|
+
getStore(): _korajs_store.Store;
|
|
103
|
+
/** Get the underlying SyncEngine instance. Null if sync not configured. */
|
|
104
|
+
getSyncEngine(): SyncEngine | null;
|
|
105
|
+
/** Gracefully close the app: stop sync, close store. */
|
|
106
|
+
close(): Promise<void>;
|
|
107
|
+
/** Dynamic collection accessors (e.g., app.todos). Typed via Object.defineProperty. */
|
|
108
|
+
[collection: string]: unknown;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A typed collection accessor with full type inference.
|
|
112
|
+
* Methods are parameterized by the inferred record, insert, and update types.
|
|
113
|
+
*/
|
|
114
|
+
interface TypedCollectionAccessor<TRecord, TInsert, TUpdate> {
|
|
115
|
+
/** Insert a new record. Returns the full record with generated id and metadata. */
|
|
116
|
+
insert(data: TInsert): Promise<TRecord>;
|
|
117
|
+
/** Find a record by its ID. */
|
|
118
|
+
findById(id: string): Promise<TRecord | null>;
|
|
119
|
+
/** Update a record by ID with partial data. Returns the updated record. */
|
|
120
|
+
update(id: string, data: TUpdate): Promise<TRecord>;
|
|
121
|
+
/** Soft-delete a record by ID. */
|
|
122
|
+
delete(id: string): Promise<void>;
|
|
123
|
+
/** Start building a query with WHERE conditions. */
|
|
124
|
+
where(conditions: Record<string, unknown>): QueryBuilder<TRecord>;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* A typed Kora application object with collection accessors inferred from the schema.
|
|
128
|
+
* Each collection becomes a property with fully typed insert/update/query methods.
|
|
129
|
+
*/
|
|
130
|
+
type TypedKoraApp<S extends SchemaInput> = {
|
|
131
|
+
/** Resolves when the store is open and collections are ready. */
|
|
132
|
+
ready: Promise<void>;
|
|
133
|
+
/** Event emitter for DevTools integration and custom listeners. */
|
|
134
|
+
events: KoraEventEmitter;
|
|
135
|
+
/** Sync control (connect/disconnect/status). Null if sync not configured. */
|
|
136
|
+
sync: SyncControl | null;
|
|
137
|
+
/** Get the underlying Store instance (for advanced use / React integration). */
|
|
138
|
+
getStore(): _korajs_store.Store;
|
|
139
|
+
/** Get the underlying SyncEngine instance. Null if sync not configured. */
|
|
140
|
+
getSyncEngine(): SyncEngine | null;
|
|
141
|
+
/** Gracefully close the app: stop sync, close store. */
|
|
142
|
+
close(): Promise<void>;
|
|
143
|
+
} & {
|
|
144
|
+
readonly [C in keyof S['collections'] & string]: S['collections'][C] extends {
|
|
145
|
+
fields: infer F extends Record<string, FieldBuilder<any, any, any>>;
|
|
146
|
+
} ? TypedCollectionAccessor<InferRecord<F>, InferInsertInput<F>, InferUpdateInput<F>> : CollectionAccessor;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Creates a new Kora application instance.
|
|
151
|
+
*
|
|
152
|
+
* Wires together store, merge engine, event emitter, and optionally sync
|
|
153
|
+
* into a single developer-facing `KoraApp` object. Collection accessors
|
|
154
|
+
* (e.g. `app.todos`) are defined as properties for immediate use after `await app.ready`.
|
|
155
|
+
*
|
|
156
|
+
* @param config - Application configuration including schema and optional sync settings
|
|
157
|
+
* @returns A KoraApp instance with reactive collections ready for use
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```typescript
|
|
161
|
+
* const app = createApp({
|
|
162
|
+
* schema: defineSchema({
|
|
163
|
+
* version: 1,
|
|
164
|
+
* collections: {
|
|
165
|
+
* todos: {
|
|
166
|
+
* fields: {
|
|
167
|
+
* title: t.string(),
|
|
168
|
+
* completed: t.boolean().default(false)
|
|
169
|
+
* }
|
|
170
|
+
* }
|
|
171
|
+
* }
|
|
172
|
+
* })
|
|
173
|
+
* })
|
|
174
|
+
*
|
|
175
|
+
* await app.ready
|
|
176
|
+
* const todo = await app.todos.insert({ title: 'Hello' })
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
/**
|
|
180
|
+
* Creates a new typed Kora application instance.
|
|
181
|
+
* When the schema is created with `defineSchema()`, full type inference flows through
|
|
182
|
+
* to collection accessors, providing autocomplete and type checking for all CRUD operations.
|
|
183
|
+
*/
|
|
184
|
+
declare function createApp<const S extends SchemaInput>(config: TypedKoraConfig<S>): TypedKoraApp<S>;
|
|
185
|
+
/**
|
|
186
|
+
* Creates a new Kora application instance (untyped fallback).
|
|
187
|
+
*/
|
|
188
|
+
declare function createApp(config: KoraConfig): KoraApp;
|
|
189
|
+
|
|
190
|
+
export { type AdapterType, type KoraApp, type KoraConfig, type StoreOptions, type SyncControl, type SyncOptions, type TypedCollectionAccessor, type TypedKoraApp, type TypedKoraConfig, createApp };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { KoraEventEmitter, SchemaDefinition, SchemaInput, FieldBuilder, InferRecord, InferInsertInput, InferUpdateInput } from '@korajs/core';
|
|
2
|
+
export { CollectionDefinition, ConnectionQuality, Constraint, FieldDescriptor, FieldKindToType, HLCTimestamp, HybridLogicalClock, InferFieldType, InferInsertInput, InferRecord, InferUpdateInput, KoraError, KoraEvent, KoraEventEmitter, KoraEventListener, KoraEventType, MergeStrategy, MergeTrace, Operation, SchemaDefinition, SchemaInput, TypedSchemaDefinition, VersionVector, createOperation, defineSchema, generateUUIDv7, t } from '@korajs/core';
|
|
3
|
+
import * as _korajs_store from '@korajs/store';
|
|
4
|
+
import { QueryBuilder, CollectionAccessor } from '@korajs/store';
|
|
5
|
+
export { CollectionAccessor, CollectionRecord, StorageAdapter, Store, StoreConfig } from '@korajs/store';
|
|
6
|
+
import { SyncStatusInfo, SyncEngine } from '@korajs/sync';
|
|
7
|
+
export { SyncConfig, SyncEngine, SyncState, SyncStatus, SyncStatusInfo, SyncStore, WebSocketTransport } from '@korajs/sync';
|
|
8
|
+
export { MergeEngine, MergeInput, MergeResult } from '@korajs/merge';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Adapter type for local storage.
|
|
12
|
+
* - 'sqlite-wasm': SQLite WASM with OPFS (browser, primary)
|
|
13
|
+
* - 'indexeddb': IndexedDB fallback (browser, when OPFS unavailable)
|
|
14
|
+
* - 'better-sqlite3': Native SQLite (Node.js, server-side, Electron)
|
|
15
|
+
*/
|
|
16
|
+
type AdapterType = 'sqlite-wasm' | 'indexeddb' | 'better-sqlite3';
|
|
17
|
+
/**
|
|
18
|
+
* Store configuration within createApp.
|
|
19
|
+
*/
|
|
20
|
+
interface StoreOptions {
|
|
21
|
+
/** Explicit adapter type. Auto-detected if omitted. */
|
|
22
|
+
adapter?: AdapterType;
|
|
23
|
+
/** Database name. Defaults to 'kora-db'. */
|
|
24
|
+
name?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sync configuration within createApp.
|
|
28
|
+
*/
|
|
29
|
+
interface SyncOptions {
|
|
30
|
+
/** WebSocket or HTTP URL for the sync server */
|
|
31
|
+
url: string;
|
|
32
|
+
/** Transport type. Defaults to 'websocket'. */
|
|
33
|
+
transport?: 'websocket' | 'http';
|
|
34
|
+
/** Auth provider function. Called before each connection attempt. */
|
|
35
|
+
auth?: () => Promise<{
|
|
36
|
+
token: string;
|
|
37
|
+
}>;
|
|
38
|
+
/** Sync scopes per collection. */
|
|
39
|
+
scopes?: Record<string, (ctx: Record<string, unknown>) => Record<string, unknown>>;
|
|
40
|
+
/** Number of operations per batch. Defaults to 100. */
|
|
41
|
+
batchSize?: number;
|
|
42
|
+
/** Schema version of this client. */
|
|
43
|
+
schemaVersion?: number;
|
|
44
|
+
/** Enable auto-reconnection on unexpected disconnect. Defaults to true. */
|
|
45
|
+
autoReconnect?: boolean;
|
|
46
|
+
/** Initial reconnection delay in ms. Defaults to 1000. */
|
|
47
|
+
reconnectInterval?: number;
|
|
48
|
+
/** Maximum reconnection delay in ms. Defaults to 30000. */
|
|
49
|
+
maxReconnectInterval?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Full configuration passed to createApp().
|
|
53
|
+
*/
|
|
54
|
+
interface KoraConfig {
|
|
55
|
+
/** The application schema. Required. */
|
|
56
|
+
schema: SchemaDefinition;
|
|
57
|
+
/** Optional store configuration. */
|
|
58
|
+
store?: StoreOptions;
|
|
59
|
+
/** Optional sync configuration. Enables sync when provided. */
|
|
60
|
+
sync?: SyncOptions;
|
|
61
|
+
/** Enable DevTools instrumentation. Defaults to false. */
|
|
62
|
+
devtools?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Typed configuration passed to createApp() when using a TypedSchemaDefinition.
|
|
66
|
+
*/
|
|
67
|
+
interface TypedKoraConfig<S extends SchemaInput> {
|
|
68
|
+
/** The application schema with preserved type information. Required. */
|
|
69
|
+
schema: SchemaDefinition & {
|
|
70
|
+
readonly __input: S;
|
|
71
|
+
};
|
|
72
|
+
/** Optional store configuration. */
|
|
73
|
+
store?: StoreOptions;
|
|
74
|
+
/** Optional sync configuration. Enables sync when provided. */
|
|
75
|
+
sync?: SyncOptions;
|
|
76
|
+
/** Enable DevTools instrumentation. Defaults to false. */
|
|
77
|
+
devtools?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Controls for the sync subsystem exposed on the KoraApp.
|
|
81
|
+
*/
|
|
82
|
+
interface SyncControl {
|
|
83
|
+
/** Connect to the sync server and start syncing. */
|
|
84
|
+
connect(): Promise<void>;
|
|
85
|
+
/** Disconnect from the sync server. */
|
|
86
|
+
disconnect(): Promise<void>;
|
|
87
|
+
/** Get the current developer-facing sync status. */
|
|
88
|
+
getStatus(): SyncStatusInfo;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The main application object returned by createApp().
|
|
92
|
+
* Collection accessors are defined as dynamic properties via Object.defineProperty.
|
|
93
|
+
*/
|
|
94
|
+
interface KoraApp {
|
|
95
|
+
/** Resolves when the store is open and collections are ready. */
|
|
96
|
+
ready: Promise<void>;
|
|
97
|
+
/** Event emitter for DevTools integration and custom listeners. */
|
|
98
|
+
events: KoraEventEmitter;
|
|
99
|
+
/** Sync control (connect/disconnect/status). Null if sync not configured. */
|
|
100
|
+
sync: SyncControl | null;
|
|
101
|
+
/** Get the underlying Store instance (for advanced use / React integration). */
|
|
102
|
+
getStore(): _korajs_store.Store;
|
|
103
|
+
/** Get the underlying SyncEngine instance. Null if sync not configured. */
|
|
104
|
+
getSyncEngine(): SyncEngine | null;
|
|
105
|
+
/** Gracefully close the app: stop sync, close store. */
|
|
106
|
+
close(): Promise<void>;
|
|
107
|
+
/** Dynamic collection accessors (e.g., app.todos). Typed via Object.defineProperty. */
|
|
108
|
+
[collection: string]: unknown;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A typed collection accessor with full type inference.
|
|
112
|
+
* Methods are parameterized by the inferred record, insert, and update types.
|
|
113
|
+
*/
|
|
114
|
+
interface TypedCollectionAccessor<TRecord, TInsert, TUpdate> {
|
|
115
|
+
/** Insert a new record. Returns the full record with generated id and metadata. */
|
|
116
|
+
insert(data: TInsert): Promise<TRecord>;
|
|
117
|
+
/** Find a record by its ID. */
|
|
118
|
+
findById(id: string): Promise<TRecord | null>;
|
|
119
|
+
/** Update a record by ID with partial data. Returns the updated record. */
|
|
120
|
+
update(id: string, data: TUpdate): Promise<TRecord>;
|
|
121
|
+
/** Soft-delete a record by ID. */
|
|
122
|
+
delete(id: string): Promise<void>;
|
|
123
|
+
/** Start building a query with WHERE conditions. */
|
|
124
|
+
where(conditions: Record<string, unknown>): QueryBuilder<TRecord>;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* A typed Kora application object with collection accessors inferred from the schema.
|
|
128
|
+
* Each collection becomes a property with fully typed insert/update/query methods.
|
|
129
|
+
*/
|
|
130
|
+
type TypedKoraApp<S extends SchemaInput> = {
|
|
131
|
+
/** Resolves when the store is open and collections are ready. */
|
|
132
|
+
ready: Promise<void>;
|
|
133
|
+
/** Event emitter for DevTools integration and custom listeners. */
|
|
134
|
+
events: KoraEventEmitter;
|
|
135
|
+
/** Sync control (connect/disconnect/status). Null if sync not configured. */
|
|
136
|
+
sync: SyncControl | null;
|
|
137
|
+
/** Get the underlying Store instance (for advanced use / React integration). */
|
|
138
|
+
getStore(): _korajs_store.Store;
|
|
139
|
+
/** Get the underlying SyncEngine instance. Null if sync not configured. */
|
|
140
|
+
getSyncEngine(): SyncEngine | null;
|
|
141
|
+
/** Gracefully close the app: stop sync, close store. */
|
|
142
|
+
close(): Promise<void>;
|
|
143
|
+
} & {
|
|
144
|
+
readonly [C in keyof S['collections'] & string]: S['collections'][C] extends {
|
|
145
|
+
fields: infer F extends Record<string, FieldBuilder<any, any, any>>;
|
|
146
|
+
} ? TypedCollectionAccessor<InferRecord<F>, InferInsertInput<F>, InferUpdateInput<F>> : CollectionAccessor;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Creates a new Kora application instance.
|
|
151
|
+
*
|
|
152
|
+
* Wires together store, merge engine, event emitter, and optionally sync
|
|
153
|
+
* into a single developer-facing `KoraApp` object. Collection accessors
|
|
154
|
+
* (e.g. `app.todos`) are defined as properties for immediate use after `await app.ready`.
|
|
155
|
+
*
|
|
156
|
+
* @param config - Application configuration including schema and optional sync settings
|
|
157
|
+
* @returns A KoraApp instance with reactive collections ready for use
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```typescript
|
|
161
|
+
* const app = createApp({
|
|
162
|
+
* schema: defineSchema({
|
|
163
|
+
* version: 1,
|
|
164
|
+
* collections: {
|
|
165
|
+
* todos: {
|
|
166
|
+
* fields: {
|
|
167
|
+
* title: t.string(),
|
|
168
|
+
* completed: t.boolean().default(false)
|
|
169
|
+
* }
|
|
170
|
+
* }
|
|
171
|
+
* }
|
|
172
|
+
* })
|
|
173
|
+
* })
|
|
174
|
+
*
|
|
175
|
+
* await app.ready
|
|
176
|
+
* const todo = await app.todos.insert({ title: 'Hello' })
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
/**
|
|
180
|
+
* Creates a new typed Kora application instance.
|
|
181
|
+
* When the schema is created with `defineSchema()`, full type inference flows through
|
|
182
|
+
* to collection accessors, providing autocomplete and type checking for all CRUD operations.
|
|
183
|
+
*/
|
|
184
|
+
declare function createApp<const S extends SchemaInput>(config: TypedKoraConfig<S>): TypedKoraApp<S>;
|
|
185
|
+
/**
|
|
186
|
+
* Creates a new Kora application instance (untyped fallback).
|
|
187
|
+
*/
|
|
188
|
+
declare function createApp(config: KoraConfig): KoraApp;
|
|
189
|
+
|
|
190
|
+
export { type AdapterType, type KoraApp, type KoraConfig, type StoreOptions, type SyncControl, type SyncOptions, type TypedCollectionAccessor, type TypedKoraApp, type TypedKoraConfig, createApp };
|