Skip to content

Commit

Permalink
Merge pull request #28 from subho57/patch-1
Browse files Browse the repository at this point in the history
Fixed templating type annotations for redo and undo functions
  • Loading branch information
laoshu133 authored Jun 15, 2024
2 parents a8dd71b + 3fe241e commit 200210d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,24 @@ export class History<T = any> {
* @param state state data to push.
* @param pickIndex if specified, only this index of state's child will be serialized.
*/
push(state: T, pickIndex?: number): Promise<History>;
push(state: T, pickIndex?: number): Promise<History<T>>;

/**
* Push state data into history.
* @param state state data to push.
* @param pickIndex if specified, only this index of state's child will be serialized.
*/
pushSync(state: T, pickIndex?: number): History;
pushSync(state: T, pickIndex?: number): History<T>;

/**
* Undo a record if possible, supports chaining.
*/
undo(): History;
undo(): History<T>;

/**
* Redo a record if possible, supports chaining.
*/
redo(): History;
redo(): History<T>;

/**
* Pull out a history state from records.
Expand All @@ -108,5 +108,5 @@ export class History<T = any> {
/**
* Clear internal data structure.
*/
reset(): History;
reset(): History<T>;
}

0 comments on commit 200210d

Please sign in to comment.