Comparing version 4.0.9-alpha.1 to 4.0.9
@@ -7,3 +7,3 @@ /* | ||
* | ||
* Version 4.0.9-alpha.1, Fri Aug 23 2024 | ||
* Version 4.0.9, Mon Oct 21 2024 | ||
* | ||
@@ -14,3 +14,3 @@ * https://dexie.org | ||
*/ | ||
// Generated by dts-bundle-generator v9.3.1 | ||
// Generated by dts-bundle-generator v5.9.0 | ||
@@ -25,3 +25,2 @@ export interface IndexSpec { | ||
src: string; | ||
type?: string | undefined; | ||
} | ||
@@ -32,6 +31,2 @@ export interface TableSchema { | ||
indexes: IndexSpec[]; | ||
yProps?: { | ||
prop: string; | ||
updatesTable: string; | ||
}[]; | ||
mappedClass: Function; | ||
@@ -371,113 +366,2 @@ idxByName: { | ||
} | ||
export interface DucktypedY { | ||
Doc: new (options?: { | ||
guid?: string; | ||
collectionid?: string; | ||
gc?: boolean; | ||
gcFilter?: any; | ||
meta?: any; | ||
autoLoad?: boolean; | ||
shouldLoad?: boolean; | ||
}) => DucktypedYDoc; | ||
applyUpdate: Function; | ||
applyUpdateV2: Function; | ||
encodeStateAsUpdate: Function; | ||
encodeStateAsUpdateV2: Function; | ||
encodeStateVector: Function; | ||
encodeStateVectorFromUpdate: Function; | ||
encodeStateVectorFromUpdateV2: Function; | ||
mergeUpdates: Function; | ||
mergeUpdatesV2: Function; | ||
diffUpdate: Function; | ||
diffUpdateV2: Function; | ||
transact: Function; | ||
} | ||
export interface DucktypedYObservable { | ||
on(name: string, f: (...args: any[]) => any): void; | ||
off(name: string, f: (...args: any[]) => any): void; | ||
once(name: string, f: (...args: any[]) => any): void; | ||
emit(name: string, args: any[]): void; | ||
destroy(): void; | ||
} | ||
/** Dock-typed Y.Doc */ | ||
export interface DucktypedYDoc extends DucktypedYObservable { | ||
guid?: any; | ||
collectionid?: any; | ||
collection?: any; | ||
whenLoaded: PromiseLike<any>; | ||
whenSynced: PromiseLike<any>; | ||
isLoaded: any; | ||
isSynced: any; | ||
transact: any; | ||
toJSON: () => any; | ||
destroy: () => void; | ||
meta?: any; | ||
share: Map<any, any>; | ||
} | ||
export interface DexieYDocMeta { | ||
db: Dexie; | ||
parentTable: string; | ||
parentId: any; | ||
parentProp: string; | ||
updatesTable: string; | ||
} | ||
/** Stored in the updates table with auto-incremented number as primary key | ||
* | ||
*/ | ||
export interface YUpdateRow { | ||
/** The primary key in the update-table | ||
* | ||
*/ | ||
i: number; | ||
/** The primary key of the row in related table holding the document property. | ||
* | ||
*/ | ||
k: IndexableType; | ||
/** The Y update | ||
* | ||
*/ | ||
u: Uint8Array; | ||
/** Optional flag | ||
* | ||
* 1 = LOCAL_CHANGE_MAYBE_UNSYNCED | ||
* | ||
*/ | ||
f?: number; | ||
} | ||
/** Stored in update tables along with YUpdateRows but with a string representing the syncing enging, as primary key | ||
* A syncing engine can create an YSyncer row with an unsentFrom value set to the a number representing primary key (i) | ||
* of updates that has not been sent to server or peer yet. Dexie will spare all updates that occur after the least | ||
* unsentFrom value in the updates table from being compressed and garbage collected into the main update. | ||
*/ | ||
export interface YSyncer { | ||
i: string; | ||
unsentFrom: number; | ||
} | ||
/** A stamp of the last compressed and garbage collected update in the update table. | ||
* The garbage collection process will find out which documents have got new updates since the last compressed update | ||
* and compress them into their corresponding main update. | ||
* | ||
* The id of this row is always 0 - which is a reserved id for this purpose. | ||
*/ | ||
export interface YLastCompressed { | ||
i: 0; | ||
lastCompressed: number; | ||
lastRun?: Date; | ||
} | ||
export interface DexieYProvider<YDoc = any> { | ||
readonly doc: YDoc; | ||
awareness?: any; | ||
whenLoaded: Promise<any>; | ||
whenSynced: Promise<any>; | ||
on: DexieEventSet & ((name: string, f: (...args: any[]) => any) => void); | ||
off(name: string, f: (...args: any[]) => any): void; | ||
destroy(): void; | ||
readonly destroyed: boolean; | ||
} | ||
export interface YDocCache { | ||
readonly size: number; | ||
find: (table: string, primaryKey: any, ydocProp: string) => DucktypedYDoc | undefined; | ||
add: (doc: DucktypedYDoc) => void; | ||
delete: (doc: DucktypedYDoc) => void; | ||
} | ||
export type KeyPaths<T> = { | ||
@@ -487,3 +371,2 @@ [P in keyof T]: P extends string ? T[P] extends Array<infer K> ? K extends any[] // Array of arrays (issue #2026) | ||
? P | `${P}.${number}` | `${P}.${number}.${KeyPaths<K>}` : P | `${P}.${number}` : T[P] extends (...args: any[]) => any // Method | ||
? never : T[P] extends DucktypedYDoc // Not valid in update spec or where clause (+ avoid circular reference) | ||
? never : T[P] extends object ? P | `${P}.${KeyPaths<T[P]>}` : P : never; | ||
@@ -578,18 +461,2 @@ }[keyof T]; | ||
} | ||
export interface RangeSetPrototype { | ||
add(rangeSet: IntervalTree | { | ||
from: IndexableType; | ||
to: IndexableType; | ||
}): RangeSet; | ||
addKey(key: IndexableType): RangeSet; | ||
addKeys(keys: IndexableType[]): RangeSet; | ||
hasKey(key: IndexableType): boolean; | ||
[Symbol.iterator](): Iterator<IntervalTreeNode, undefined, IndexableType | undefined>; | ||
} | ||
export type RangeSet = RangeSetPrototype & IntervalTree; | ||
export interface RangeSetConstructor { | ||
(tree: IntervalTree): RangeSet; | ||
new (): RangeSet; | ||
new (from: IndexableType, to?: IndexableType): RangeSet; | ||
} | ||
export interface DexieOnReadyEvent { | ||
@@ -615,8 +482,4 @@ subscribe(fn: (vipDb: Dexie) => any, bSticky: boolean): void; | ||
} | ||
export interface DexieYEvent { | ||
subscribe(fn: (provider: DexieYProvider, Y: any) => void): void; | ||
unsubscribe(fn: (provider: DexieYProvider, Y: any) => void): void; | ||
fire(provider: DexieYProvider, Y: any): void; | ||
} | ||
export interface DbEventFns { | ||
export interface DbEvents extends DexieEventSet { | ||
(eventName: "ready", subscriber: (vipDb: Dexie) => any, bSticky?: boolean): void; | ||
(eventName: "populate", subscriber: (trans: Transaction) => any): void; | ||
@@ -626,6 +489,2 @@ (eventName: "blocked", subscriber: (event: IDBVersionChangeEvent) => any): void; | ||
(eventName: "close", subscriber: (event: Event) => any): void; | ||
(eventName: "y", subscriber: (provider: DexieYProvider, Y: any) => void): void; | ||
} | ||
export interface DbEvents extends DbEventFns, DexieEventSet { | ||
(eventName: "ready", subscriber: (vipDb: Dexie) => any, bSticky?: boolean): void; | ||
ready: DexieOnReadyEvent; | ||
@@ -636,3 +495,2 @@ populate: DexiePopulateEvent; | ||
close: DexieCloseEvent; | ||
y: DexieYEvent; | ||
} | ||
@@ -968,3 +826,2 @@ /** Set of mutated parts of the database | ||
}; | ||
readonly _options: DexieOptions; | ||
readonly core: DBCore; | ||
@@ -976,3 +833,2 @@ _createTransaction: (this: Dexie, mode: IDBTransactionMode, storeNames: ArrayLike<string>, dbschema: DbSchema, parentTransaction?: Transaction | null) => Transaction; | ||
on: DbEvents; | ||
once: DbEventFns; | ||
open(): PromiseExtended<Dexie>; | ||
@@ -1006,3 +862,2 @@ table<T = any, TKey = IndexableType, TInsertType = T>(tableName: string): Table<T, TKey, TInsertType>; | ||
}): this; | ||
gc(): Promise<void>; | ||
// Make it possible to touch physical class constructors where they reside - as properties on db instance. | ||
@@ -1166,3 +1021,2 @@ // For example, checking if (x instanceof db.Table). Can't do (x instanceof Dexie.Table because it's just a virtual interface) | ||
} | ||
// There typings are extracted from https://github.com/tc39/proposal-observable | ||
declare global { | ||
@@ -1246,3 +1100,2 @@ interface SymbolConstructor { | ||
cache?: "immutable" | "cloned" | "disabled"; | ||
Y?: DucktypedY; // Caller supplies Y from the following: import * as Y from 'yjs'; | ||
} | ||
@@ -1294,13 +1147,5 @@ export interface DexieConstructor extends DexieExceptionClasses { | ||
*/ | ||
export type NonInsertProps<T> = { | ||
export type MethodProps<T> = { | ||
[P in keyof T]: IsStrictlyAny<T[P]> extends true ? never // Plain property of type any (not method) | ||
: T[P] extends (...args: any[]) => any ? P // a function (method) | ||
: T[P] extends { | ||
on: any; | ||
subdocs: any; | ||
gc: any; | ||
isSynced: any; | ||
isLoaded: any; | ||
shouldLoad: any; | ||
} ? P // an YDoc property - should be generated by dexie and not by user | ||
: never; | ||
@@ -1312,3 +1157,3 @@ }[keyof T]; | ||
*/ | ||
export type InsertType<T, OptionalProps extends keyof T> = Omit<T, OptionalProps | NonInsertProps<T>> & { | ||
export type InsertType<T, OptionalProps extends keyof T> = Omit<T, OptionalProps | MethodProps<T>> & { | ||
[P in OptionalProps]?: T[P]; | ||
@@ -1323,3 +1168,2 @@ }; | ||
export declare var Dexie: DexieConstructor; | ||
// Alias of Table and Collection in order to be able to refer them from module below... | ||
export interface _Table<T, TKey, TInsertType> extends Table<T, TKey, TInsertType> { | ||
@@ -1329,4 +1173,2 @@ } | ||
} | ||
// Besides being the only exported value, let Dexie also be | ||
// a namespace for types... | ||
export declare module Dexie { | ||
@@ -1345,3 +1187,2 @@ // The "Dexie.Promise" type. | ||
export function rangesOverlap(rangeSet1: IntervalTree, rangeSet2: IntervalTree): boolean; | ||
declare var RangeSet$1: RangeSetConstructor; | ||
export function cmp(a: any, b: any): number; | ||
@@ -1351,13 +1192,6 @@ export function replacePrefix(a: string, b: string): PropModification; | ||
export function remove(num: number | bigint | any[]): PropModification; | ||
export declare var DexieYProvider: { | ||
(doc: DucktypedYDoc): DexieYProvider; | ||
new (doc: DucktypedYDoc): DexieYProvider; | ||
getDocCache: (db: Dexie) => YDocCache; | ||
}; | ||
/** Exporting 'Dexie' as the default export. | ||
**/ | ||
export default Dexie; | ||
export { | ||
Dexie as default, | ||
RangeSet$1 as RangeSet, | ||
}; | ||
export {}; |
{ | ||
"name": "dexie", | ||
"version": "4.0.9-alpha.1", | ||
"version": "4.0.9", | ||
"description": "A Minimalistic Wrapper for IndexedDB", | ||
@@ -69,3 +69,3 @@ "main": "dist/dexie.js", | ||
"tsc [--watch 'Watching for file changes']", | ||
"tsc --target es2021 --outdir ../tools/tmp/modern/src/", | ||
"tsc --target es2020 --outdir ../tools/tmp/modern/src/", | ||
"rollup -c ../tools/build-configs/rollup.config.js", | ||
@@ -111,3 +111,3 @@ "rollup -c ../tools/build-configs/rollup.umd.config.js", | ||
"cross-env": "^7.0.3", | ||
"dts-bundle-generator": "^9.3.1", | ||
"dts-bundle-generator": "^5.9.0", | ||
"just-build": "^0.9.24", | ||
@@ -134,5 +134,3 @@ "karma": "^6.1.1", | ||
"typescript": "^5.3.3", | ||
"uglify-js": "^3.9.2", | ||
"y-protocols": "^1.0.6", | ||
"yjs": "^13.6.16" | ||
"uglify-js": "^3.9.2" | ||
}, | ||
@@ -139,0 +137,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
25
0
2983669
22
19272