source: imaps-frontend/node_modules/react-router-dom/dist/dom.d.ts@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 4.2 KB
Line 
1import type { FormEncType, HTMLFormMethod, RelativeRoutingType } from "@remix-run/router";
2export declare const defaultMethod: HTMLFormMethod;
3export declare function isHtmlElement(object: any): object is HTMLElement;
4export declare function isButtonElement(object: any): object is HTMLButtonElement;
5export declare function isFormElement(object: any): object is HTMLFormElement;
6export declare function isInputElement(object: any): object is HTMLInputElement;
7type LimitedMouseEvent = Pick<MouseEvent, "button" | "metaKey" | "altKey" | "ctrlKey" | "shiftKey">;
8export declare function shouldProcessLinkClick(event: LimitedMouseEvent, target?: string): boolean;
9export type ParamKeyValuePair = [string, string];
10export type URLSearchParamsInit = string | ParamKeyValuePair[] | Record<string, string | string[]> | URLSearchParams;
11/**
12 * Creates a URLSearchParams object using the given initializer.
13 *
14 * This is identical to `new URLSearchParams(init)` except it also
15 * supports arrays as values in the object form of the initializer
16 * instead of just strings. This is convenient when you need multiple
17 * values for a given key, but don't want to use an array initializer.
18 *
19 * For example, instead of:
20 *
21 * let searchParams = new URLSearchParams([
22 * ['sort', 'name'],
23 * ['sort', 'price']
24 * ]);
25 *
26 * you can do:
27 *
28 * let searchParams = createSearchParams({
29 * sort: ['name', 'price']
30 * });
31 */
32export declare function createSearchParams(init?: URLSearchParamsInit): URLSearchParams;
33export declare function getSearchParamsForLocation(locationSearch: string, defaultSearchParams: URLSearchParams | null): URLSearchParams;
34type JsonObject = {
35 [Key in string]: JsonValue;
36} & {
37 [Key in string]?: JsonValue | undefined;
38};
39type JsonArray = JsonValue[] | readonly JsonValue[];
40type JsonPrimitive = string | number | boolean | null;
41type JsonValue = JsonPrimitive | JsonObject | JsonArray;
42export type SubmitTarget = HTMLFormElement | HTMLButtonElement | HTMLInputElement | FormData | URLSearchParams | JsonValue | null;
43/**
44 * Submit options shared by both navigations and fetchers
45 */
46interface SharedSubmitOptions {
47 /**
48 * The HTTP method used to submit the form. Overrides `<form method>`.
49 * Defaults to "GET".
50 */
51 method?: HTMLFormMethod;
52 /**
53 * The action URL path used to submit the form. Overrides `<form action>`.
54 * Defaults to the path of the current route.
55 */
56 action?: string;
57 /**
58 * The encoding used to submit the form. Overrides `<form encType>`.
59 * Defaults to "application/x-www-form-urlencoded".
60 */
61 encType?: FormEncType;
62 /**
63 * Determines whether the form action is relative to the route hierarchy or
64 * the pathname. Use this if you want to opt out of navigating the route
65 * hierarchy and want to instead route based on /-delimited URL segments
66 */
67 relative?: RelativeRoutingType;
68 /**
69 * In browser-based environments, prevent resetting scroll after this
70 * navigation when using the <ScrollRestoration> component
71 */
72 preventScrollReset?: boolean;
73 /**
74 * Enable flushSync for this submission's state updates
75 */
76 unstable_flushSync?: boolean;
77}
78/**
79 * Submit options available to fetchers
80 */
81export interface FetcherSubmitOptions extends SharedSubmitOptions {
82}
83/**
84 * Submit options available to navigations
85 */
86export interface SubmitOptions extends FetcherSubmitOptions {
87 /**
88 * Set `true` to replace the current entry in the browser's history stack
89 * instead of creating a new one (i.e. stay on "the same page"). Defaults
90 * to `false`.
91 */
92 replace?: boolean;
93 /**
94 * State object to add to the history stack entry for this navigation
95 */
96 state?: any;
97 /**
98 * Indicate a specific fetcherKey to use when using navigate=false
99 */
100 fetcherKey?: string;
101 /**
102 * navigate=false will use a fetcher instead of a navigation
103 */
104 navigate?: boolean;
105 /**
106 * Enable view transitions on this submission navigation
107 */
108 unstable_viewTransition?: boolean;
109}
110export declare function getFormSubmissionInfo(target: SubmitTarget, basename: string): {
111 action: string | null;
112 method: string;
113 encType: string;
114 formData: FormData | undefined;
115 body: any;
116};
117export {};
Note: See TracBrowser for help on using the repository browser.