@espresso-lab/mantine-data-table 1.0.6 → 1.0.8
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/Hooks/useApi.d.ts +11 -10
- package/dist/Hooks/usePersitentState.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +5705 -5748
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +40 -40
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/Hooks/useApi.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export interface BaseEntity {
|
|
2
2
|
id: string | number;
|
|
3
3
|
}
|
|
4
|
+
type AtLeast<T, K extends keyof T> = Partial<T> & Pick<T, K>;
|
|
4
5
|
export declare function getApiHeaders(): Promise<{
|
|
5
6
|
length: number;
|
|
6
7
|
toString(): string;
|
|
@@ -104,15 +105,15 @@ export declare function getApiHeaders(): Promise<{
|
|
|
104
105
|
"Content-Type": string;
|
|
105
106
|
Authorization: string;
|
|
106
107
|
}>;
|
|
107
|
-
|
|
108
|
+
export declare function getAll<T extends BaseEntity>(path: string): Promise<T[]>;
|
|
108
109
|
export declare function getOne<T extends BaseEntity>(path: string, id: string | number): Promise<T>;
|
|
109
|
-
export declare function
|
|
110
|
-
export declare function
|
|
111
|
-
export declare function
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
export declare function useAddOne<T extends BaseEntity>(apiPath: string, queryKey:
|
|
116
|
-
export declare function useUpdateOne<T extends BaseEntity>(apiPath: string, queryKey:
|
|
117
|
-
export declare function useDeleteOne
|
|
110
|
+
export declare function deleteOne(path: string, id: string | number): Promise<void>;
|
|
111
|
+
export declare function createOne<C, T extends BaseEntity>(path: string, item: C): Promise<T>;
|
|
112
|
+
export declare function api<R, U>(method: "GET" | "POST" | "PUT" | "DELETE", path: string, payload?: U): Promise<R>;
|
|
113
|
+
export declare function updateOne<T extends BaseEntity>(path: string, item: AtLeast<T, "id">): Promise<T>;
|
|
114
|
+
export declare function useGetOne<T extends BaseEntity>(apiPath: string, queryKey: Array<string | number>, id: string | number): import('@tanstack/react-query').UseQueryResult<T, Error>;
|
|
115
|
+
export declare function useGetAll<T extends BaseEntity>(apiPath: string, queryKey: Array<string | number>, enabled?: boolean): import('@tanstack/react-query').UseQueryResult<T[], Error>;
|
|
116
|
+
export declare function useAddOne<T extends BaseEntity>(apiPath: string, queryKey: Array<string | number>): import('@tanstack/react-query').UseMutationResult<T, Error, Omit<T, "id">, unknown>;
|
|
117
|
+
export declare function useUpdateOne<T extends BaseEntity>(apiPath: string, queryKey: Array<string | number>): import('@tanstack/react-query').UseMutationResult<T, Error, AtLeast<T, "id">, unknown>;
|
|
118
|
+
export declare function useDeleteOne(apiPath: string, queryKey: Array<string | number>): import('@tanstack/react-query').UseMutationResult<void, Error, string | number, unknown>;
|
|
118
119
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function usePersistentState<T>(initialValue: T, key: string): [T, (value: T) => void];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './Hooks/useApi';
|
|
2
|
+
export type * from './Hooks/useApi';
|
|
2
3
|
export type { DataTableProps } from './DataTable/DataTableInner.tsx';
|
|
3
4
|
export { DataTable } from './DataTable/DataTable.tsx';
|
|
5
|
+
export * from './Hooks/usePersitentState.ts';
|