Skip to content

Commit

Permalink
feat: add type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
fczbkk committed May 7, 2023
1 parent 1b537e9 commit 9578d07
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
},
"dependencies": {
"array-reduce-prototypejs-fix": "^1.2.0"
}
},
"types": "types/index.d.ts"
}
21 changes: 21 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
interface UrlMatchFragmentDebug {
pattern: string,
value: string,
result: boolean
}

interface UrlMatchPatternDebug {
scheme: UrlMatchFragmentDebug,
host: UrlMatchFragmentDebug,
path: UrlMatchFragmentDebug,
params: UrlMatchFragmentDebug,
fragment: UrlMatchFragmentDebug,
}

export default class UrlMatch {
constructor(patterns?: string[]);
add(patterns?: string[]): string[];
remove(patterns?: string[]): string[];
test(content: string): boolean;
debug(content: string): Record<string, UrlMatchPatternDebug>;
}

0 comments on commit 9578d07

Please sign in to comment.