Skip to content

Commit

Permalink
Revert "Propsal to replace #1764"
Browse files Browse the repository at this point in the history
This reverts commit 1bfb4a6.
  • Loading branch information
dfahlander committed Feb 7, 2024
1 parent 1bfb4a6 commit 3577103
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
10 changes: 0 additions & 10 deletions src/public/types/pojo.d.ts

This file was deleted.

9 changes: 4 additions & 5 deletions src/public/types/table-hooks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { DexieEventSet } from "./dexie-event-set";
import { DexieEvent } from "./dexie-event";
import { Transaction } from "./transaction";
import { IndexableType } from "./indexable-type";
import { Pojo } from "./pojo";

interface CreatingHookContext<T,Key> {
onsuccess?: (primKey: Key) => void;
Expand All @@ -20,10 +19,10 @@ interface DeletingHookContext<T,Key> {
}

interface TableHooks<T=any,TKey=IndexableType,TInsertType=T> extends DexieEventSet {
(eventName: 'creating', subscriber: (this: CreatingHookContext<TInsertType,TKey>, primKey:TKey, obj:TInsertType, transaction:Transaction) => void | undefined | TKey): void;
(eventName: 'reading', subscriber: (obj:Pojo<T>) => Pojo<T> | any): void;
(eventName: 'updating', subscriber: (this: UpdatingHookContext<Pojo<T>,TKey>, modifications:Object, primKey:TKey, obj:T, transaction:Transaction) => any): void;
(eventName: 'deleting', subscriber: (this: DeletingHookContext<Pojo<T>,TKey>, primKey:TKey, obj:Pojo<T>, transaction:Transaction) => any): void;
(eventName: 'creating', subscriber: (this: CreatingHookContext<T,TKey>, primKey:TKey, obj:T, transaction:Transaction) => void | undefined | TKey): void;
(eventName: 'reading', subscriber: (obj:TInsertType) => T | any): void;
(eventName: 'updating', subscriber: (this: UpdatingHookContext<T,TKey>, modifications:Object, primKey:TKey, obj:T, transaction:Transaction) => any): void;
(eventName: 'deleting', subscriber: (this: DeletingHookContext<T,TKey>, primKey:TKey, obj:T, transaction:Transaction) => any): void;
creating: DexieEvent;
reading: DexieEvent;
updating: DexieEvent;
Expand Down

0 comments on commit 3577103

Please sign in to comment.