@mapcreator/api 2.9.0 → 3.0.0

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 (121) hide show
  1. package/dist/ImageHandler.d.ts +56 -0
  2. package/dist/Mapcreator.d.ts +338 -0
  3. package/dist/PaginatedResourceListing.d.ts +156 -0
  4. package/dist/RequestParameters.d.ts +241 -0
  5. package/dist/ResourceLister.d.ts +155 -0
  6. package/dist/bundle.browser.js +49 -99
  7. package/dist/bundle.browser.min.js +1 -1
  8. package/dist/bundle.browser.min.js.LICENSE.txt +2 -2
  9. package/dist/bundle.js +48 -98
  10. package/dist/bundle.min.js +1 -1
  11. package/dist/bundle.min.js.LICENSE.txt +1 -1
  12. package/dist/enums/DeletedState.d.ts +16 -0
  13. package/dist/enums/Enum.d.ts +40 -0
  14. package/dist/enums/JobShareVisibility.d.ts +15 -0
  15. package/dist/enums/ResultStatus.d.ts +17 -0
  16. package/dist/enums/index.d.ts +5 -0
  17. package/dist/errors/AbstractError.d.ts +26 -0
  18. package/dist/errors/ApiError.d.ts +65 -0
  19. package/dist/errors/GeoError.d.ts +6 -0
  20. package/dist/errors/NodeError.d.ts +6 -0
  21. package/dist/errors/OAuthError.d.ts +17 -0
  22. package/dist/errors/StaticClassError.d.ts +7 -0
  23. package/dist/errors/ValidationError.d.ts +125 -0
  24. package/dist/errors/index.d.ts +8 -0
  25. package/dist/index.d.ts +27 -0
  26. package/dist/oauth/DummyFlow.d.ts +19 -0
  27. package/dist/oauth/ImplicitFlow.d.ts +68 -0
  28. package/dist/oauth/ImplicitFlowPopup.d.ts +25 -0
  29. package/dist/oauth/OAuth.d.ts +50 -0
  30. package/dist/oauth/OAuthToken.d.ts +67 -0
  31. package/dist/oauth/PasswordFlow.d.ts +56 -0
  32. package/dist/oauth/StateContainer.d.ts +36 -0
  33. package/dist/proxy/GeoResourceProxy.d.ts +69 -0
  34. package/dist/proxy/OrganisationProxy.d.ts +62 -0
  35. package/dist/proxy/OwnedResourceProxy.d.ts +60 -0
  36. package/dist/proxy/ResourceProxy.d.ts +32 -0
  37. package/dist/proxy/SimpleResourceProxy.d.ts +76 -0
  38. package/dist/proxy/index.d.ts +6 -0
  39. package/dist/resources/Choropleth.d.ts +20 -0
  40. package/dist/resources/Color.d.ts +9 -0
  41. package/dist/resources/Contract.d.ts +7 -0
  42. package/dist/resources/Dimension.d.ts +7 -0
  43. package/dist/resources/DimensionSet.d.ts +11 -0
  44. package/dist/resources/Domain.d.ts +7 -0
  45. package/dist/resources/Faq.d.ts +7 -0
  46. package/dist/resources/Feature.d.ts +9 -0
  47. package/dist/resources/Font.d.ts +4 -0
  48. package/dist/resources/FontFamily.d.ts +11 -0
  49. package/dist/resources/Highlight.d.ts +4 -0
  50. package/dist/resources/InsetMap.d.ts +10 -0
  51. package/dist/resources/Job.d.ts +56 -0
  52. package/dist/resources/JobResult.d.ts +76 -0
  53. package/dist/resources/JobRevision.d.ts +64 -0
  54. package/dist/resources/JobShare.d.ts +15 -0
  55. package/dist/resources/JobType.d.ts +9 -0
  56. package/dist/resources/Language.d.ts +4 -0
  57. package/dist/resources/Layer.d.ts +10 -0
  58. package/dist/resources/LayerFaq.d.ts +8 -0
  59. package/dist/resources/LayerGroup.d.ts +14 -0
  60. package/dist/resources/Mapstyle.d.ts +8 -0
  61. package/dist/resources/MapstyleSet.d.ts +13 -0
  62. package/dist/resources/MapstyleSetColor.d.ts +8 -0
  63. package/dist/resources/Message.d.ts +7 -0
  64. package/dist/resources/MessageVariant.d.ts +4 -0
  65. package/dist/resources/Notification.d.ts +4 -0
  66. package/dist/resources/Organisation.d.ts +97 -0
  67. package/dist/resources/Permission.d.ts +4 -0
  68. package/dist/resources/ProductTour.d.ts +10 -0
  69. package/dist/resources/ProductTourStep.d.ts +7 -0
  70. package/dist/resources/Role.d.ts +14 -0
  71. package/dist/resources/Svg.d.ts +4 -0
  72. package/dist/resources/SvgSet.d.ts +11 -0
  73. package/dist/resources/Tag.d.ts +9 -0
  74. package/dist/resources/TagType.d.ts +13 -0
  75. package/dist/resources/User.d.ts +119 -0
  76. package/dist/resources/VectorChoropleth.d.ts +4 -0
  77. package/dist/resources/VectorHighlight.d.ts +4 -0
  78. package/dist/resources/base/CrudBase.d.ts +65 -0
  79. package/dist/resources/base/CrudBase.d.ts.map +1 -0
  80. package/dist/resources/base/CrudSetBase.d.ts +27 -0
  81. package/dist/resources/base/CrudSetBase.d.ts.map +1 -0
  82. package/dist/resources/base/CrudSetItemBase.d.ts +19 -0
  83. package/dist/resources/base/CrudSetItemBase.d.ts.map +1 -0
  84. package/dist/resources/base/DownloadedResource.d.ts +72 -0
  85. package/dist/resources/base/DownloadedResource.d.ts.map +1 -0
  86. package/dist/resources/base/ResourceBase.d.ts +162 -0
  87. package/dist/resources/base/ResourceBase.d.ts.map +1 -0
  88. package/dist/resources/index.d.ts +45 -0
  89. package/dist/storage/CookiesDriver.d.ts +37 -0
  90. package/dist/storage/DataStoreContract.d.ts +46 -0
  91. package/dist/storage/DummyDriver.d.ts +15 -0
  92. package/dist/storage/FileDriver.d.ts +54 -0
  93. package/dist/storage/LocalStorageDriver.d.ts +13 -0
  94. package/dist/storage/StorageManager.d.ts +46 -0
  95. package/dist/traits/HandlesImages.d.ts +15 -0
  96. package/dist/traits/Injectable.d.ts +60 -0
  97. package/dist/traits/OwnableResource.d.ts +18 -0
  98. package/dist/traits/Trait.d.ts +12 -0
  99. package/dist/utils/Logger.d.ts +55 -0
  100. package/dist/utils/Singleton.d.ts +9 -0
  101. package/dist/utils/StaticClass.d.ts +7 -0
  102. package/dist/utils/Unobservable.d.ts +13 -0
  103. package/dist/utils/base64.d.ts +12 -0
  104. package/dist/utils/geo.d.ts +74 -0
  105. package/dist/utils/hash.d.ts +15 -0
  106. package/dist/utils/helpers.d.ts +47 -0
  107. package/dist/utils/node.d.ts +15 -0
  108. package/dist/utils/reflection.d.ts +43 -0
  109. package/dist/utils/requests.d.ts +24 -0
  110. package/dist/utils/uuid.d.ts +19 -0
  111. package/package.json +4 -1
  112. package/src/Mapcreator.js +44 -34
  113. package/src/enums/index.js +1 -1
  114. package/src/errors/index.js +6 -6
  115. package/src/index.js +14 -14
  116. package/src/proxy/index.js +5 -5
  117. package/src/resources/index.js +36 -36
  118. package/dist/bundle.browser.js.map +0 -1
  119. package/dist/bundle.browser.min.js.map +0 -1
  120. package/dist/bundle.js.map +0 -1
  121. package/dist/bundle.min.js.map +0 -1
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Image resource handler
3
+ * @protected
4
+ */
5
+ export default class ImageHandler {
6
+ /**
7
+ * @param {Mapcreator} api - Api instance
8
+ * @param {ResourceBase} target - Instance of target item
9
+ */
10
+ constructor(api: Mapcreator, target: ResourceBase);
11
+ _api: Mapcreator;
12
+ _target: ResourceBase;
13
+ /**
14
+ * Get api instance
15
+ * @returns {Mapcreator} - Api instance
16
+ */
17
+ get api(): Mapcreator;
18
+ /**
19
+ * Resource url, can be used in an image tag
20
+ * @returns {string} - Resource url
21
+ */
22
+ get url(): string;
23
+ /**
24
+ * Delete image
25
+ * @throws {ApiError} - If the api returns errors
26
+ * @returns {CancelablePromise}
27
+ */
28
+ delete(): CancelablePromise;
29
+ /**
30
+ * Download the image
31
+ * @returns {CancelablePromise<DownloadedResource>} - image
32
+ * @throws {ApiError} - If the api returns errors
33
+ * @example
34
+ * // Browser
35
+ * layer.imageHandler.download().then(image => {
36
+ * $('img').src = image.createObjectURL();
37
+ * });
38
+ *
39
+ * // NodeJs
40
+ * layer.imageHandler.download().then({fileName, data} => {
41
+ * fs.writeFileSync(fileName, data);
42
+ * });
43
+ */
44
+ download(): CancelablePromise<DownloadedResource>;
45
+ /**
46
+ * Upload new image
47
+ * @param {ArrayBuffer|ArrayBufferView|File|Blob|Buffer} image - Image file
48
+ * @returns {CancelablePromise}
49
+ * @throws {ApiError} - If the api returns errors
50
+ */
51
+ upload(image: ArrayBuffer | ArrayBufferView | File | Blob | Buffer): CancelablePromise;
52
+ }
53
+ import Mapcreator from "./Mapcreator";
54
+ import ResourceBase from "./resources/base/ResourceBase";
55
+ import DownloadedResource from "./resources/base/DownloadedResource";
56
+ //# sourceMappingURL=ImageHandler.d.ts.map
@@ -0,0 +1,338 @@
1
+ /**
2
+ * Base API class
3
+ *
4
+ * @mixes Injectable
5
+ * @extends EventEmitter
6
+ * @fires Mapcreator#error
7
+ */
8
+ export default class Mapcreator {
9
+ /**
10
+ * @param {OAuth|string} auth - Authentication flow
11
+ * @param {string} host - Remote API host
12
+ */
13
+ constructor(auth?: OAuth | string, host?: string);
14
+ /**
15
+ * Set authentication provider instance
16
+ * @param {OAuth} value -- OAuth instance
17
+ */
18
+ set auth(arg: OAuth);
19
+ /**
20
+ * Get authentication provider instance
21
+ * @returns {OAuth} - OAuth instance
22
+ */
23
+ get auth(): OAuth;
24
+ /**
25
+ * The remote host
26
+ * @param {string} value - A valid url
27
+ */
28
+ set host(arg: string);
29
+ /**
30
+ * The current host
31
+ * @returns {string} - The current host
32
+ */
33
+ get host(): string;
34
+ _logger: Logger;
35
+ /**
36
+ * Get api version
37
+ * @returns {string} - Api version
38
+ * @constant
39
+ */
40
+ get version(): string;
41
+ /**
42
+ * Get logger instance
43
+ * @returns {Logger} - Logger instance
44
+ */
45
+ get logger(): Logger;
46
+ _auth: OAuth;
47
+ /**
48
+ * Test if the client is authenticated with the api and has a valid token
49
+ * @returns {boolean} - If the client is authenticated with the api
50
+ */
51
+ get authenticated(): boolean;
52
+ _host: string;
53
+ get url(): string;
54
+ /**
55
+ * Saves the session token so that it can be recovered at a later time. The wrapper can
56
+ * find the token most of the time if the name parameter is left blank.
57
+ * @param {string?} name - name of the token
58
+ */
59
+ saveToken(name: string | null): void;
60
+ /**
61
+ * Authenticate with the api using the authentication method provided.
62
+ * @returns {Promise<Mapcreator>} - Current instance
63
+ * @throws {OAuthError}
64
+ * @throws {ApiError} - If the api returns errors
65
+ */
66
+ authenticate(): Promise<Mapcreator>;
67
+ /**
68
+ * Mapcreator ky instance
69
+ * This ky instance takes care of the API communication. It has the following responsibilities:
70
+ * - Send authenticated requests to the API
71
+ * - Transform errors returned from the API into ApiError and ValidationError if possible
72
+ * - Wait when the rate limiter responds with a 429 and retry later
73
+ * - Prefix urls with the api domain if needed
74
+ * @returns {function}
75
+ * @see {@link https://github.com/sindresorhus/ky}
76
+ */
77
+ get ky(): Function;
78
+ _ky: any;
79
+ wrapKy(wrapper: any, ...args: any[]): void;
80
+ /**
81
+ * Static proxy generation
82
+ * @param {string|Class} Target - Constructor or url
83
+ * @param {Class?} Constructor - Constructor for a resource that the results should be cast to
84
+ * @returns {ResourceProxy} - A proxy for accessing the resource
85
+ * @example
86
+ * api.static('/custom/resource/path/{id}/').get(123);
87
+ *
88
+ * @example
89
+ * class FooBar extends ResourceBase {
90
+ * static get resourceName() {
91
+ * return 'custom';
92
+ * }
93
+ * }
94
+ *
95
+ * api.static(FooBar)
96
+ * .get(1)
97
+ * .then(console.log);
98
+ *
99
+ * api.static('/foo-bar-custom', FooBar).lister();
100
+ */
101
+ static(Target: string | Class, Constructor?: Class): ResourceProxy;
102
+ /**
103
+ * Choropleth accessor
104
+ * @see {@link Choropleth}
105
+ * @returns {GeoResourceProxy<Choropleth>} - A proxy for accessing the resource
106
+ */
107
+ get choropleths(): any;
108
+ /**
109
+ * VectorChoropleth accessor
110
+ * @see {@link VectorChoropleth}
111
+ * @returns {GeoResourceProxy<VectorChoropleth>} - A proxy for accessing the resource
112
+ */
113
+ get vectorChoropleths(): any;
114
+ /**
115
+ * Color accessor
116
+ * @see {@link Color}
117
+ * @returns {ResourceProxy<Color>} - A proxy for accessing the resource
118
+ */
119
+ get colors(): any;
120
+ /**
121
+ * Tag accessor
122
+ * @see {@link Tag}
123
+ * @returns {ResourceProxy<Tag>} - A proxy for accessing the resource
124
+ */
125
+ get tags(): any;
126
+ /**
127
+ * Tag accessor
128
+ * @see {@link TagType}
129
+ * @returns {ResourceProxy<TagType>} - A proxy for accessing the resource
130
+ */
131
+ get tagTypes(): any;
132
+ /**
133
+ * Contract accessor
134
+ * @see {@link Contract}
135
+ * @returns {ResourceProxy<Contract>} - A proxy for accessing the resource
136
+ */
137
+ get contracts(): any;
138
+ /**
139
+ * Dimension accessor
140
+ * @see {@link Dimension}
141
+ * @returns {ResourceProxy<Dimension>} - A proxy for accessing the resource
142
+ */
143
+ get dimensions(): any;
144
+ /**
145
+ * Dimension set accessor
146
+ * @see {@link DimensionSet}
147
+ * @returns {ResourceProxy<DimensionSet>} - A proxy for accessing the resource
148
+ */
149
+ get dimensionSets(): any;
150
+ /**
151
+ * Faq accessor
152
+ * @see {@link Faq}
153
+ * @returns {ResourceProxy<Faq>} - A proxy for accessing the resource
154
+ */
155
+ get faqs(): any;
156
+ /**
157
+ * Feature accessor
158
+ * @see {@link Feature}
159
+ * @returns {ResourceProxy<Feature>} - A proxy for accessing the resource
160
+ */
161
+ get features(): any;
162
+ /**
163
+ * Featured jobs accessor
164
+ * @see {@link Job}
165
+ * @returns {SimpleResourceProxy<Job>} - A proxy for accessing the resource
166
+ */
167
+ get featuredMaps(): any;
168
+ /**
169
+ * Font accessor
170
+ * @see {@link Font}
171
+ * @returns {ResourceProxy<Font>} - A proxy for accessing the resource
172
+ */
173
+ get fonts(): any;
174
+ /**
175
+ * FontFamily accessor
176
+ * @see {@link FontFamily}
177
+ * @returns {ResourceProxy<FontFamily>} - A proxy for accessing the resource
178
+ */
179
+ get fontFamilies(): any;
180
+ /**
181
+ * Highlight accessor
182
+ * @see {@link Highlight}
183
+ * @returns {GeoResourceProxy<Highlight>} - A proxy for accessing the resource
184
+ */
185
+ get highlights(): any;
186
+ /**
187
+ * VectorHighlight accessor
188
+ * @see {@link VectorHighlight}
189
+ * @returns {GeoResourceProxy<VectorHighlight>} - A proxy for accessing the resource
190
+ */
191
+ get vectorHighlights(): any;
192
+ /**
193
+ * InsetMap accessor
194
+ * @see {@link InsetMap}
195
+ * @returns {GeoResourceProxy<InsetMap>} - A proxy for accessing the resource
196
+ */
197
+ get insetMaps(): any;
198
+ /**
199
+ * Job accessor
200
+ * @see {@link Job}
201
+ * @returns {ResourceProxy<Job>} - A proxy for accessing the resource
202
+ */
203
+ get jobs(): any;
204
+ /**
205
+ * JobShare accessor
206
+ * @see {@link JobShare}
207
+ * @returns {ResourceProxy<JobShare>} - A proxy for accessing the resource
208
+ */
209
+ get jobShares(): any;
210
+ /**
211
+ * JobType accessor
212
+ * @see {@link JobType}
213
+ * @returns {ResourceProxy<JobType>} - A proxy for accessing the resource
214
+ */
215
+ get jobTypes(): any;
216
+ /**
217
+ * Language accessor
218
+ * @see {@link Language}
219
+ * @returns {ResourceProxy<Language>} - A proxy for accessing the resource
220
+ */
221
+ get languages(): any;
222
+ /**
223
+ * Layer accessor
224
+ * @see {@link Layer}
225
+ * @returns {ResourceProxy<Layer>} - A proxy for accessing the resource
226
+ */
227
+ get layers(): any;
228
+ /**
229
+ * LayerFaq accessor
230
+ * @see {@link LayerFaq}
231
+ * @returns {ResourceProxy<LayerFaq>} - A proxy for accessing the resource
232
+ */
233
+ get layerFaqs(): any;
234
+ /**
235
+ * Layer group accessor
236
+ * @see {@link LayerGroup}
237
+ * @returns {ResourceProxy<LayerGroup>} - A proxy for accessing the resource
238
+ */
239
+ get layerGroups(): any;
240
+ /**
241
+ * Mapstyle accessor
242
+ * @see {@link Mapstyle}
243
+ * @returns {ResourceProxy<Mapstyle>} - A proxy for accessing the resource
244
+ */
245
+ get mapstyles(): any;
246
+ /**
247
+ * MapstyleSet accessor
248
+ * @see {@link MapstyleSet}
249
+ * @returns {ResourceProxy<MapstyleSet>} - A proxy for accessing the resource
250
+ */
251
+ get mapstyleSets(): any;
252
+ /**
253
+ * Notification accessor
254
+ * @see {@link Notification}
255
+ * @returns {ResourceProxy<Notification>} - A proxy for accessing the resource
256
+ */
257
+ get notifications(): any;
258
+ /**
259
+ * Message accessor
260
+ * @see {@link Message}
261
+ * @returns {ResourceProxy<Message>} - A proxy for accessing the resource
262
+ */
263
+ get messages(): any;
264
+ /**
265
+ * Organisation accessor
266
+ * @see {@link Organisation}
267
+ * @returns {ResourceProxy<Organisation>} - A proxy for accessing the resource
268
+ */
269
+ get organisations(): any;
270
+ /**
271
+ * Permission accessor
272
+ * @see {@link Permission}
273
+ * @returns {ResourceProxy<Permission>} - A proxy for accessing the resource
274
+ */
275
+ get permissions(): any;
276
+ /**
277
+ * Product tour accessor
278
+ * @see {@link ProductTour}
279
+ * @returns {ResourceProxy<ProductTour>} - A proxy for accessing the resource
280
+ */
281
+ get productTours(): any;
282
+ /**
283
+ * Product tour step accessor
284
+ * @see {@link ProductTourStep}
285
+ * @returns {ResourceProxy<ProductTourStep>} - A proxy for accessing the resource
286
+ */
287
+ get productTourSteps(): any;
288
+ /**
289
+ * Role accessor
290
+ * @see {@link Role}
291
+ * @returns {ResourceProxy<Role>} - A proxy for accessing the resource
292
+ */
293
+ get roles(): any;
294
+ /**
295
+ * Svg accessor
296
+ * @see {@link Svg}
297
+ * @returns {ResourceProxy<Svg>} - A proxy for accessing the resource
298
+ */
299
+ get svgs(): any;
300
+ /**
301
+ * SvgSet accessor
302
+ * @see {@link SvgSet}
303
+ * @returns {ResourceProxy<SvgSet>} - A proxy for accessing the resource
304
+ */
305
+ get svgSets(): any;
306
+ /**
307
+ * User accessor
308
+ * @see {@link User}
309
+ * @returns {ResourceProxy<User>} - A proxy for accessing the resource
310
+ */
311
+ get users(): any;
312
+ /**
313
+ * Get SVG set types
314
+ * @see {@link SvgSet}
315
+ * @returns {CancelablePromise<Enum>} - Contains all the possible SVG set types
316
+ * @throws {ApiError} - If the api returns errors
317
+ */
318
+ getSvgSetTypes(): CancelablePromise<Enum>;
319
+ /**
320
+ * Get font styles
321
+ * @see {@link Font}
322
+ * @returns {CancelablePromise<Enum>} - Contains all the possible font styles
323
+ * @throws {ApiError} - If the api returns errors
324
+ */
325
+ getFontStyles(): CancelablePromise<Enum>;
326
+ /**
327
+ * Forget the current session
328
+ * This will clean up any stored OAuth states stored using {@link StateContainer} and any OAuth tokens stored
329
+ * @returns {CancelablePromise}
330
+ * @throws {ApiError} - If the api returns errors
331
+ */
332
+ logout(): CancelablePromise;
333
+ }
334
+ import OAuth from "./oauth/OAuth";
335
+ import Logger from "./utils/Logger";
336
+ import ResourceProxy from "./proxy/ResourceProxy";
337
+ import { Enum } from "./enums";
338
+ //# sourceMappingURL=Mapcreator.d.ts.map
@@ -0,0 +1,156 @@
1
+ /**
2
+ * Proxy for accessing paginated resources
3
+ */
4
+ export default class PaginatedResourceListing {
5
+ /**
6
+ * @param {Mapcreator} api - Instance of the api
7
+ * @param {String} route - Resource route
8
+ * @param {Class<ResourceBase>} Target - Wrapper target
9
+ * @param {RequestParameters} parameters - Request parameters
10
+ * @param {Number} pageCount - Resolved page count
11
+ * @param {Number} rowCount - Resolved rowCount
12
+ * @param {Array<ResourceBase>} data - Resolved data
13
+ * @private
14
+ */
15
+ private constructor();
16
+ _api: Mapcreator;
17
+ /**
18
+ * Override the target route
19
+ * @param {String} value - route
20
+ */
21
+ set route(arg: string);
22
+ /**
23
+ * Target route
24
+ * @returns {String} - Url
25
+ */
26
+ get route(): string;
27
+ _Target: Class<ResourceBase>;
28
+ _parameters: RequestParameters;
29
+ _pageCount: number;
30
+ _rows: number;
31
+ _data: ResourceBase[];
32
+ /**
33
+ * Get api instance
34
+ * @returns {Mapcreator} - Api instance
35
+ */
36
+ get api(): Mapcreator;
37
+ _route: string;
38
+ /**
39
+ * Target to wrap results in
40
+ * @returns {Class<ResourceBase>} - Target constructor
41
+ */
42
+ get Target(): Class<ResourceBase>;
43
+ /**
44
+ * Request parameters
45
+ * @param {RequestParameters} value - Request parameters
46
+ */
47
+ set parameters(arg: RequestParameters);
48
+ /**
49
+ * Request parameters
50
+ * @returns {RequestParameters} - Request parameters
51
+ */
52
+ get parameters(): RequestParameters;
53
+ /**
54
+ * Current page number
55
+ * @returns {Number} - Current page
56
+ */
57
+ get page(): number;
58
+ /**
59
+ * Maximum amount of items per page
60
+ * @returns {Number} - Amount of items
61
+ */
62
+ get perPage(): number;
63
+ /**
64
+ * Current sorting value
65
+ * @param {Array<String>} value - Sort
66
+ */
67
+ set sort(arg: string[]);
68
+ /**
69
+ * Set sort direction
70
+ * @returns {Array<String>} - Sort
71
+ * @example
72
+ * const sort = ['-name', 'id']
73
+ */
74
+ get sort(): string[];
75
+ /**
76
+ * Deleted items filter state
77
+ * @param {String} value - Deleted items filter state
78
+ * @see {@link DeletedState}
79
+ */
80
+ set deleted(arg: string);
81
+ /**
82
+ * Deleted items filter state
83
+ * @returns {String} value - Deleted items filter state
84
+ * @see {@link DeletedState}
85
+ */
86
+ get deleted(): string;
87
+ /**
88
+ * Amount of pages available
89
+ * @returns {Number} - Page count
90
+ */
91
+ get pageCount(): number;
92
+ /**
93
+ * Page data
94
+ * @returns {Array<ResourceBase>} - Wrapped data
95
+ */
96
+ get data(): ResourceBase[];
97
+ /**
98
+ * Row count
99
+ * @returns {Number} - Row count
100
+ */
101
+ get rows(): number;
102
+ /**
103
+ * Optional search query
104
+ * @param {Object<String, String|Array<String>>} value - Query
105
+ * @throws {TypeError}
106
+ * @default {}
107
+ * @see {@link ResourceProxy#search}
108
+ */
109
+ set query(arg: any);
110
+ /**
111
+ * Optional search query
112
+ * @default {}
113
+ * @return {Object<String, String|Array<String>>} - Query
114
+ */
115
+ get query(): any;
116
+ /**
117
+ * Get target page
118
+ * @param {Number} page - Page number
119
+ * @param {Number} perPage - Amount of items per page (max 50)
120
+ * @returns {CancelablePromise<PaginatedResourceListing>} - Target page
121
+ * @throws {ApiError} - If the api returns errors
122
+ */
123
+ getPage(page?: number, perPage?: number): CancelablePromise<PaginatedResourceListing>;
124
+ /**
125
+ * If there is a next page
126
+ * @returns {boolean} - If there is a next page
127
+ */
128
+ get hasNext(): boolean;
129
+ /**
130
+ * If there is a previous page
131
+ * @returns {boolean} - If there is a previous page
132
+ */
133
+ get hasPrevious(): boolean;
134
+ /**
135
+ * Used for caching pages internally
136
+ * @returns {string} - Cache token
137
+ * @see {@link PaginatedResourceWrapper}
138
+ * @see {@link ResourceCache}
139
+ */
140
+ get cacheToken(): string;
141
+ /**
142
+ * Get next page
143
+ * @returns {CancelablePromise<PaginatedResourceListing>} - Paginated resource
144
+ * @throws {ApiError} - If the api returns errors
145
+ */
146
+ next(): CancelablePromise<PaginatedResourceListing>;
147
+ /**
148
+ * Get previous page
149
+ * @returns {CancelablePromise<PaginatedResourceListing>} - Paginated resource
150
+ * @throws {ApiError} - If the api returns errors
151
+ */
152
+ previous(): CancelablePromise<PaginatedResourceListing>;
153
+ }
154
+ import Mapcreator from "./Mapcreator";
155
+ import RequestParameters from "./RequestParameters";
156
+ //# sourceMappingURL=PaginatedResourceListing.d.ts.map