// Generated by dts-bundle-generator v8.1.2 import { ChildDom, TagFunc } from 'vanjs-core'; declare const config: { underScoreToDash: boolean; camelCaseToDash: boolean; alignDigitToDash: boolean; prefix: string; suffix: string; }; export type TagMap = RecursiveTagMap & { [K in keyof HTMLElementTagNameMap]: RecursiveTagMap & TagFunc; } & ((namepaceUri: string) => RecursiveTagMap); export interface RecursiveTagMap { [key: string]: RecursiveTagMap & TagFunc; } export interface WrappedFnTypes { pathway?: string[]; classes?: string[]; namespace?: boolean; carryOtherProps?: any; classConversionConfig?: typeof config; changeResultFn?: (pathway: string[], prop: string, target: TagMap) => TagMap; } /** * * TODO: get the form to hold and sync a state * TODO: get submit and reset to sync w/ state * TODO: sync up events to trigger state changes * TODO: add default states? * * Alternate form elements: * checkbox * color * date * datetime-local * email * file * hidden * image * month * number * password * radio * range * search * textarea */ export interface FormConfig { onSubmit?: (e: any) => void; } /** * 1. Exclusions ("not" routes) and other matching options (via extraKeys) * - not = ensure the next segment is not the pattern provided * - regex = match the pattern provided * - notRegex = ensure the next segment does not match the pattern provided * - optional = the next segment is optional * - multiple = the next segment can be repeated * - oneOf = the next segment can be one of the provided options * - allOf = the next segment must match all of the provided options * - param = next segment is a named parameter & pattern * - escape = next segment is a literal string, can be escaped characters and/or one of the above options * 2. Query parameters * 3. Data loaders? + loading displays * 4. Route guards / authentication * 5. Route transitions? */ export type RouteMatcherObject = { not: RouteMatcher; } | { regex: RegExp; } | { notRegex: RegExp; } | { optional: RouteMatcher; } | { multiple: RouteMatcher; } | { oneOf: RouteMatcher[]; } | { allOf: RouteMatcher[]; } | { param: { name: string; test: RouteMatcher; }; } | { escape: RouteMatcher; } | { matchAny: true; } | { fn: (segment: string) => { matches: boolean; increment?: number; params?: any; hasParams?: boolean; }; }; export type RouteMatcher = string | RouteMatcherObject; export interface ActiveRoute { routePath: string[]; } export interface MatchResult { show: boolean; params: Record; hasParams: boolean; } export interface RoutePassthrough { currentRoute: { path: RouteMatcher[]; hasParams?: boolean; }; extraProps: Record; baseRoute?: string; } export type ExtraKeys = keyof ExtraKeyObject; export interface RecursiveRouteMap { [key: string]: RecursiveRouteMap & TagFunc & ExtraKeysAsFinal; } export type ExtraKeysAsFinal = { [K in ExtraKeys]: ReturnType[K]>; }; export type FinalRouteObject = RecursiveRouteMap & ExtraKeysAsFinal & TagFunc; declare class ExtraKeyObject { not: (route: RoutePassthrough) => (prop: RouteMatcher) => FinalRouteObject; regex: (route: RoutePassthrough) => (prop: string | RegExp) => FinalRouteObject; notRegex: (route: RoutePassthrough) => (prop: string | RegExp) => FinalRouteObject; optional: (route: RoutePassthrough) => (prop: RouteMatcher) => FinalRouteObject; multiple: (route: RoutePassthrough) => (prop: RouteMatcher) => FinalRouteObject; escape: (route: RoutePassthrough) => (prop: string) => FinalRouteObject; fn: (route: RoutePassthrough) => (prop: (segment: string) => { matches: boolean; increment?: number; params?: any; hasParams?: boolean; }) => FinalRouteObject; oneOf: (prps: RoutePassthrough) => (...props: RouteMatcher[]) => FinalRouteObject; allOf: (prps: RoutePassthrough) => (...props: RouteMatcher[]) => FinalRouteObject; param: (prps: RoutePassthrough) => (name: string, test: RouteMatcher) => FinalRouteObject; any: (prps: RoutePassthrough) => FinalRouteObject; getRoute: (prps: RoutePassthrough) => (params?: Record) => string; getRouteMatchString: (prps: RoutePassthrough) => string; addExtraProps: (prps: RoutePassthrough) => (extraProps: Record) => FinalRouteObject; getRouteMatchTest: (prps: RoutePassthrough) => (exampleUrl: string) => boolean; getPassthrough: (prps: RoutePassthrough) => RoutePassthrough; getRouteMatchFull: (prps: RoutePassthrough) => (exampleUrl: string) => MatchResult; } export type RouteInputs = ((params: Record) => ChildDom | ChildDom[]) | ChildDom | ChildDom[]; declare const _default: { tags: TagMap; add: (dom: Element, ...children: readonly import("vanjs-core").ChildDom[]) => Element; derive: (f: () => T) => import("vanjs-core").State; state: { (): import("vanjs-core").State; (initVal: T_2): import("vanjs-core").State; }; createForm: (formInputs: FormConfig) => { form: RecursiveTagMap & import("vanjs-core").TagFunc; inputs: Record & import("vanjs-core").TagFunc>; buttons: { submit: RecursiveTagMap & import("vanjs-core").TagFunc; reset: RecursiveTagMap & import("vanjs-core").TagFunc; }; submit: RecursiveTagMap & import("vanjs-core").TagFunc; reset: RecursiveTagMap & import("vanjs-core").TagFunc; state: import("vanjs-core").State; }; internal: { wrapperFn: (target1: TagMap, opts?: WrappedFnTypes) => TagMap; }; createRouter: (r?: RoutePassthrough | undefined) => FinalRouteObject<((params: Record) => import("vanjs-core").ChildDom | import("vanjs-core").ChildDom[]) | import("vanjs-core").ChildDom | import("vanjs-core").ChildDom[]>; routeTo: (...extras: (string | string[] | FinalRouteObject<((params: Record) => import("vanjs-core").ChildDom | import("vanjs-core").ChildDom[]) | import("vanjs-core").ChildDom | import("vanjs-core").ChildDom[]>)[]) => string; activeRoute: import("vanjs-core").State; }; export { _default as default, }; export {};