@variantjs/vue
Version:
Vue VariantJS: Fully configurable Vue 3 components styled with TailwindCSS
47 lines (46 loc) • 1.89 kB
TypeScript
declare type RouteParamValue = string;
declare type RouteParamValueRaw = RouteParamValue | number;
declare type RouteParamsRaw = Record<string, RouteParamValueRaw | RouteParamValueRaw[]>;
declare type RouteRecordName = string | symbol;
interface LocationAsRelativeRaw {
name?: RouteRecordName;
params?: RouteParamsRaw;
}
declare type HistoryStateArray = Array<HistoryStateValue>;
declare type HistoryStateValue = string | number | boolean | null | undefined | HistoryState | HistoryStateArray;
/**
* Allowed HTML history.state
*/
interface HistoryState {
[x: number]: HistoryStateValue;
[x: string]: HistoryStateValue;
}
interface RouteLocationOptions {
/**
* Replace the entry in the history instead of pushing a new entry
*/
replace?: boolean;
/**
* Triggers the navigation even if the location is the same as the current one
*/
force?: boolean;
/**
* State to save using the History API. This cannot contain any reactive
* values and some primitives like Symbols are forbidden. More info at
* https://developer.mozilla.org/en-US/docs/Web/API/History/state
*/
state?: HistoryState;
}
interface LocationAsPath {
path: string;
}
declare type LocationQueryValue = string | null;
declare type LocationQueryValueRaw = LocationQueryValue | number | undefined;
declare type LocationQueryRaw = Record<string | number, LocationQueryValueRaw | LocationQueryValueRaw[]>;
interface RouteQueryAndHash {
query?: LocationQueryRaw;
hash?: string;
}
declare type VueRouteRouteLocationRaw = string | (RouteQueryAndHash & LocationAsPath & RouteLocationOptions) | (RouteQueryAndHash & LocationAsRelativeRaw & RouteLocationOptions);
declare type VueRouteAriaCurrentValue = 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | undefined;
export { VueRouteAriaCurrentValue, VueRouteRouteLocationRaw };