utils.d.ts 929 B

123456789101112131415161718192021222324252627282930313233
  1. interface StoryData {
  2. viewMode?: string;
  3. storyId?: string;
  4. }
  5. interface SeparatorOptions {
  6. rootSeparator: string | RegExp;
  7. groupSeparator: string | RegExp;
  8. }
  9. export declare const knownNonViewModesRegex: RegExp;
  10. export declare const sanitize: (string: string) => string;
  11. export declare const toId: (kind: string, name: string) => string;
  12. export declare const parsePath: (path?: string) => StoryData;
  13. interface Query {
  14. [key: string]: any;
  15. }
  16. export declare const queryFromString: (s: string) => Query;
  17. export declare const queryFromLocation: (location: { search: string }) => Query;
  18. export declare const stringifyQuery: (query: Query) => any;
  19. export declare const getMatch: (
  20. current: string,
  21. target: string,
  22. startsWith?: boolean
  23. ) => {
  24. path: string;
  25. };
  26. export declare const parseKind: (
  27. kind: string,
  28. { rootSeparator, groupSeparator }: SeparatorOptions
  29. ) => {
  30. root: string;
  31. groups: string[];
  32. };
  33. export {};