alinea
Version:
[](https://npmjs.org/package/alinea) [](https://packagephobia.com/result?p=alinea)
25 lines (24 loc) • 1.01 kB
TypeScript
export declare const hashAtom: import("jotai").WritableAtom<string, [hash: string], void> & {
init: string;
};
export declare const locationAtom: import("jotai").WritableAtom<URL, [url: string], void>;
interface Matcher {
keys: Array<string>;
pattern: RegExp;
}
export declare function createParams(matcher: Matcher, match: RegExpExecArray): Record<string, string>;
interface MatchOptions {
route: string;
loose?: boolean;
}
export declare const matchAtoms: import("jotai/vanilla/utils/atomFamily").AtomFamily<MatchOptions, import("jotai").Atom<Record<string, string> | undefined>>;
export declare function useMatch(route: string, loose?: boolean): [Record<string, string> | undefined, never];
export declare const useHash: () => [string, (hash: string) => void];
export declare function useLocation(): URL;
export declare function useNavigate(): (url: string) => void;
export declare function link(url: string | undefined): {
href: string;
} | {
href?: undefined;
};
export {};