@shlinkio/shlink-frontend-kit 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import type { CardProps } from 'reactstrap';
2
- import type { ChangeEvent } from 'react';
3
- import type { DropdownToggleProps } from 'reactstrap/types/lib/DropdownToggle';
4
- import type { FC } from 'react';
5
- import type { InputType } from 'reactstrap/types/lib/Input';
1
+ import { CardProps } from 'reactstrap';
2
+ import { ChangeEvent } from 'react';
3
+ import { DropdownToggleProps } from 'reactstrap/types/lib/DropdownToggle';
4
+ import { FC } from 'react';
5
+ import { InputType } from 'reactstrap/types/lib/Input';
6
6
  import { JSX as JSX_2 } from 'react/jsx-runtime';
7
7
  import { MutableRefObject } from 'react';
8
- import type { PropsWithChildren } from 'react';
9
- import type { ReactNode } from 'react';
8
+ import { PropsWithChildren } from 'react';
9
+ import { ReactNode } from 'react';
10
10
 
11
11
  declare type BooleanControlProps = PropsWithChildren<{
12
12
  checked?: boolean;
@@ -118,8 +118,15 @@ export declare type OrderingDropdownProps<T extends string = string> = {
118
118
 
119
119
  export declare const orderToString: <T>(order: Order<T>) => string | undefined;
120
120
 
121
+ /** @deprecated Use parseQueryString instead */
121
122
  export declare const parseQuery: <T>(search: string) => T;
122
123
 
124
+ /**
125
+ * Parses provided query string into an object.
126
+ * Parameters ending with "[]" will be considered arrays and returned as a single prop with all values.
127
+ */
128
+ export declare const parseQueryString: <T>(search: string) => T;
129
+
123
130
  export declare const PRIMARY_DARK_COLOR = "#161b22";
124
131
 
125
132
  export declare const PRIMARY_LIGHT_COLOR = "white";
@@ -156,7 +163,16 @@ export declare type SimpleCardProps = Omit<CardProps, 'title'> & {
156
163
 
157
164
  export declare const sortList: <List>(list: List[], { field, dir }: Order<keyof List>) => List[];
158
165
 
159
- export declare const stringifyQuery: (query: any) => string;
166
+ /** @deprecated Use stringifyQueryParams instead */
167
+ export declare const stringifyQuery: (params: Record<string, unknown | unknown[] | undefined>) => string;
168
+
169
+ /**
170
+ * Stringify an object of query parameters.
171
+ * Keys explicitly defined with undefined value will be skipped.
172
+ * Arrays will be appended multiple times with the "[]" suffix in the param name.
173
+ * All values are cast to string.
174
+ */
175
+ export declare const stringifyQueryParams: (params: Record<string, unknown | unknown[] | undefined>) => string;
160
176
 
161
177
  export declare const stringToOrder: <T>(order: string) => Order<T>;
162
178
 
@@ -176,7 +192,7 @@ export declare const useOrder: <T>(initialOrder: Order<T>) => [Order<T>, (orderF
176
192
 
177
193
  export declare const useParsedQuery: <T>() => T;
178
194
 
179
- export declare const useTimeoutToggle: (initialValue?: boolean, delay?: number, setTimeout?: ((handler: TimerHandler, timeout?: number | undefined, ...arguments: any[]) => number) & typeof globalThis.setTimeout, clearTimeout?: ((id: number | undefined) => void) & typeof globalThis.clearTimeout) => [boolean, () => void];
195
+ export declare const useTimeoutToggle: (initialValue?: boolean, delay?: number, setTimeout?: ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number) & typeof globalThis.setTimeout, clearTimeout?: ((id: number | undefined) => void) & typeof globalThis.clearTimeout) => [boolean, () => void];
180
196
 
181
197
  export declare const useToggle: (initialValue?: boolean) => ToggleResult;
182
198