@micromag/data 0.4.88 → 0.4.90-alpha.1

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.
Files changed (2) hide show
  1. package/es/index.d.ts +41 -38
  2. package/package.json +3 -3
package/es/index.d.ts CHANGED
@@ -2,39 +2,42 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
3
 
4
4
  declare const useContributionCreate: ({ screenId, visitorId: providedVisitorId, storyId: providedStoryId, onSuccess, }?: {
5
- visitorId?: any;
6
- storyId?: any;
7
- onSuccess?: any;
5
+ visitorId?: null | undefined;
6
+ storyId?: null | undefined;
7
+ onSuccess?: null | undefined;
8
8
  }) => {
9
9
  create: (data: any) => any;
10
10
  creating: boolean;
11
11
  };
12
12
 
13
- declare const useContributions: (options?: any) => {
14
- load?: (...args: any[]) => any;
15
- loading?: boolean;
16
- error?: boolean;
17
- contributions: any;
13
+ declare const useContributions: (options?: null) => {
14
+ load?: ((...args: any[]) => any) | undefined;
15
+ loading?: boolean | undefined;
16
+ error?: boolean | undefined;
17
+ contributions: {
18
+ name: string;
19
+ message: string;
20
+ }[];
18
21
  };
19
22
 
20
23
  declare const useData: (loadData: any, { initialData, autoload }?: {
21
- initialData?: any;
22
- autoload?: boolean;
24
+ initialData?: null | undefined;
25
+ autoload?: boolean | undefined;
23
26
  }) => {
24
- data: any;
27
+ data: null;
25
28
  load: (...args: any[]) => any;
26
29
  loading: boolean;
27
30
  error: boolean;
28
31
  };
29
32
 
30
33
  declare const useItems: ({ getPage, getItems, page, count, items: providedItems, pages: initialPages, getPageFromResponse, getItemsFromResponse, onItemsLoaded, onPageLoaded, onLoaded, onError, }: {
31
- getPage?: any;
32
- getItems?: any;
33
- page?: any;
34
- count?: number;
35
- items?: any;
36
- pages?: any;
37
- getPageFromResponse?: ({ meta: { current_page: currentPage, last_page: lastPage, total }, data: items, }: {
34
+ getPage?: null | undefined;
35
+ getItems?: null | undefined;
36
+ page?: null | undefined;
37
+ count?: number | undefined;
38
+ items?: null | undefined;
39
+ pages?: null | undefined;
40
+ getPageFromResponse?: (({ meta: { current_page: currentPage, last_page: lastPage, total }, data: items, }: {
38
41
  meta: {
39
42
  current_page: any;
40
43
  last_page: any;
@@ -46,12 +49,12 @@ declare const useItems: ({ getPage, getItems, page, count, items: providedItems,
46
49
  lastPage: number;
47
50
  total: number;
48
51
  items: any;
49
- };
50
- getItemsFromResponse?: (data: any) => any;
51
- onItemsLoaded?: any;
52
- onPageLoaded?: any;
53
- onLoaded?: any;
54
- onError?: any;
52
+ }) | undefined;
53
+ getItemsFromResponse?: ((data: any) => any) | undefined;
54
+ onItemsLoaded?: null | undefined;
55
+ onPageLoaded?: null | undefined;
56
+ onLoaded?: null | undefined;
57
+ onError?: null | undefined;
55
58
  }) => {
56
59
  items: any;
57
60
  pages: any;
@@ -69,11 +72,11 @@ declare const useMedia: (id: any, opts: any) => {
69
72
  load: (...args: any[]) => any;
70
73
  loading: boolean;
71
74
  error: boolean;
72
- story: any;
75
+ story: null;
73
76
  };
74
77
 
75
- declare const useMediaAuthors: (query: any, count: number, opts: any) => {
76
- authors: any[];
78
+ declare const useMediaAuthors: (query: null | undefined, count: number | undefined, opts: any) => {
79
+ authors: never[];
77
80
  };
78
81
 
79
82
  declare const useMediaCreate: () => {
@@ -81,8 +84,8 @@ declare const useMediaCreate: () => {
81
84
  creating: boolean;
82
85
  };
83
86
 
84
- declare const useMedias: (query?: any, page?: number, count?: number, opts?: any) => {
85
- items: any;
87
+ declare const useMedias: (query?: null, page?: number, count?: number, opts?: null) => {
88
+ items: null;
86
89
  total: any;
87
90
  page: any;
88
91
  count: any;
@@ -100,7 +103,7 @@ declare const useMediasRecent: (opts: any, key?: string) => {
100
103
  getSearches: (count?: number) => any;
101
104
  };
102
105
 
103
- declare const useMediaTags: (query?: any, count?: number, opts?: any) => {
106
+ declare const useMediaTags: (query?: null, count?: number, opts?: null) => {
104
107
  pages: any;
105
108
  total: any;
106
109
  lastPage: any;
@@ -127,21 +130,21 @@ declare const useMediaDelete: () => {
127
130
  deleting: boolean;
128
131
  };
129
132
 
130
- declare const useQuiz: (options?: any) => {
131
- load?: (...args: any[]) => any;
132
- loading?: boolean;
133
- error?: boolean;
134
- quiz: any;
133
+ declare const useQuiz: (options?: null) => {
134
+ load?: ((...args: any[]) => any) | undefined;
135
+ loading?: boolean | undefined;
136
+ error?: boolean | undefined;
137
+ quiz: never[];
135
138
  };
136
139
 
137
- declare const useQuizCreate: (options?: any) => {
140
+ declare const useQuizCreate: (options?: null) => {
138
141
  create: (data: any) => any;
139
142
  creating: boolean;
140
143
  };
141
144
 
142
145
  declare class Base {
143
146
  constructor(opts?: {});
144
- requestGet(path: any, query?: any): Promise<unknown>;
147
+ requestGet(path: any, query?: null): Promise<unknown>;
145
148
  requestPost(path: any, data: any): Promise<unknown>;
146
149
  requestPut(path: any, data: any): Promise<unknown>;
147
150
  requestDelete(path: any): Promise<unknown>;
@@ -153,7 +156,7 @@ declare class Api extends Base {
153
156
  constructor(opts?: {});
154
157
  }
155
158
 
156
- declare const useApi: () => unknown;
159
+ declare const useApi: () => null;
157
160
  interface ApiProviderProps {
158
161
  api?: Api;
159
162
  baseUrl?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/data",
3
- "version": "0.4.88",
3
+ "version": "0.4.90-alpha.1",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -60,7 +60,7 @@
60
60
  "@babel/runtime": "^7.28.6",
61
61
  "@folklore/fetch": "^0.1.17",
62
62
  "@folklore/routes": "^0.4.4",
63
- "@micromag/core": "^0.4.88",
63
+ "@micromag/core": "^0.4.90-alpha.1",
64
64
  "lodash": "^4.17.23",
65
65
  "query-string": "^9.0.0"
66
66
  },
@@ -68,6 +68,6 @@
68
68
  "access": "public",
69
69
  "registry": "https://registry.npmjs.org/"
70
70
  },
71
- "gitHead": "cf331286bb6037d61e664cd5c961955c136719c6",
71
+ "gitHead": "a13dd2242ee733dc3b3663354783f0b4395f9926",
72
72
  "types": "es/index.d.ts"
73
73
  }