next-recomponents 2.0.38 → 2.0.39
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.mts +1 -31
- package/dist/index.d.ts +1 -31
- package/dist/index.js +291 -395
- package/dist/index.mjs +316 -420
- package/package.json +1 -1
- package/src/use-resources/index.ts +378 -475
package/dist/index.d.mts
CHANGED
|
@@ -118,38 +118,8 @@ interface Props$1<T extends Record<string, ItemsRecord>> {
|
|
|
118
118
|
endpoints: T;
|
|
119
119
|
onError?: (error: any) => void;
|
|
120
120
|
}
|
|
121
|
-
interface ShowOptions {
|
|
122
|
-
limit?: number;
|
|
123
|
-
merge?: boolean;
|
|
124
|
-
page?: number;
|
|
125
|
-
[key: string | number]: string | number | undefined | null | boolean;
|
|
126
|
-
}
|
|
127
|
-
type EnhancedEndpoints<T extends Record<string, ItemsRecord>> = {
|
|
128
|
-
[K in keyof T]: {
|
|
129
|
-
typeof: T[K]["typeof"];
|
|
130
|
-
state: "success" | "loading" | "error";
|
|
131
|
-
show: (props: ShowOptions) => Promise<Array<T[K]["typeof"]>>;
|
|
132
|
-
create: (data: Partial<T[K]["typeof"]> | Partial<T[K]["typeof"]>[]) => Promise<T[K]["typeof"]>;
|
|
133
|
-
update: (id: number | string, data: Partial<T[K]["typeof"]> | Partial<T[K]["typeof"]>[]) => Promise<T[K]["typeof"]>;
|
|
134
|
-
remove: (id: number | string) => Promise<T[K]["typeof"]>;
|
|
135
|
-
find: (id: number | string, props?: Record<string, string>) => Promise<T[K]["typeof"]>;
|
|
136
|
-
getAllPages: (limit: number) => Promise<Array<T[K]["typeof"]>>;
|
|
137
|
-
data: Array<T[K]["typeof"]>;
|
|
138
|
-
selectedItem: T[K]["typeof"];
|
|
139
|
-
params: Record<string, any>;
|
|
140
|
-
currentPage: number;
|
|
141
|
-
totalItems: number;
|
|
142
|
-
totalPages: number;
|
|
143
|
-
errorMessage: string | undefined;
|
|
144
|
-
autoLoad?: boolean;
|
|
145
|
-
defaultParams?: Record<string, any>;
|
|
146
|
-
id?: number | string;
|
|
147
|
-
loaded: boolean;
|
|
148
|
-
setLoaded: () => void;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
121
|
|
|
152
|
-
declare function useResources<T extends Record<string, ItemsRecord>>({ baseURI, endpoints, onError, }: Props$1<T>):
|
|
122
|
+
declare function useResources<T extends Record<string, ItemsRecord>>({ baseURI, endpoints, onError, }: Props$1<T>): any;
|
|
153
123
|
|
|
154
124
|
interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
155
125
|
label?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -118,38 +118,8 @@ interface Props$1<T extends Record<string, ItemsRecord>> {
|
|
|
118
118
|
endpoints: T;
|
|
119
119
|
onError?: (error: any) => void;
|
|
120
120
|
}
|
|
121
|
-
interface ShowOptions {
|
|
122
|
-
limit?: number;
|
|
123
|
-
merge?: boolean;
|
|
124
|
-
page?: number;
|
|
125
|
-
[key: string | number]: string | number | undefined | null | boolean;
|
|
126
|
-
}
|
|
127
|
-
type EnhancedEndpoints<T extends Record<string, ItemsRecord>> = {
|
|
128
|
-
[K in keyof T]: {
|
|
129
|
-
typeof: T[K]["typeof"];
|
|
130
|
-
state: "success" | "loading" | "error";
|
|
131
|
-
show: (props: ShowOptions) => Promise<Array<T[K]["typeof"]>>;
|
|
132
|
-
create: (data: Partial<T[K]["typeof"]> | Partial<T[K]["typeof"]>[]) => Promise<T[K]["typeof"]>;
|
|
133
|
-
update: (id: number | string, data: Partial<T[K]["typeof"]> | Partial<T[K]["typeof"]>[]) => Promise<T[K]["typeof"]>;
|
|
134
|
-
remove: (id: number | string) => Promise<T[K]["typeof"]>;
|
|
135
|
-
find: (id: number | string, props?: Record<string, string>) => Promise<T[K]["typeof"]>;
|
|
136
|
-
getAllPages: (limit: number) => Promise<Array<T[K]["typeof"]>>;
|
|
137
|
-
data: Array<T[K]["typeof"]>;
|
|
138
|
-
selectedItem: T[K]["typeof"];
|
|
139
|
-
params: Record<string, any>;
|
|
140
|
-
currentPage: number;
|
|
141
|
-
totalItems: number;
|
|
142
|
-
totalPages: number;
|
|
143
|
-
errorMessage: string | undefined;
|
|
144
|
-
autoLoad?: boolean;
|
|
145
|
-
defaultParams?: Record<string, any>;
|
|
146
|
-
id?: number | string;
|
|
147
|
-
loaded: boolean;
|
|
148
|
-
setLoaded: () => void;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
121
|
|
|
152
|
-
declare function useResources<T extends Record<string, ItemsRecord>>({ baseURI, endpoints, onError, }: Props$1<T>):
|
|
122
|
+
declare function useResources<T extends Record<string, ItemsRecord>>({ baseURI, endpoints, onError, }: Props$1<T>): any;
|
|
153
123
|
|
|
154
124
|
interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
155
125
|
label?: string;
|