Skip to content

Commit

Permalink
chore(core): improve TS type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip committed Jul 24, 2024
1 parent fa8febd commit d63843a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nimma",
"version": "0.6.0",
"version": "0.7.0",
"description": "Scalable JSONPath engine.",
"keywords": [
"json",
Expand Down
19 changes: 15 additions & 4 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,27 @@ export type EmittedScope = {
readonly value: unknown;
};

export type Scope = {
sandbox: {
value: unknown;
};
path: (string | number)[];
callbacks: Record<string, Callback>;
};

export type State = {
value: number;
initialValue: number;
};

export type CustomShorthand = (
scope: Scope,
state: State,
initialValue: number,
) => void;

export type Options = {
customShorthands?: Record<
string,
(path: JsonPath, state?: State, initialValue?: number) => void
>;
customShorthands?: Record<string, CustomShorthand>;
module?: 'esm' | 'commonjs';
};

Expand Down

0 comments on commit d63843a

Please sign in to comment.