@mapcreator/api 2.8.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 (123) 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 +1264 -1253
  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 +1263 -1252
  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 +53 -33
  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/LayerFaq.js +47 -0
  118. package/src/resources/LayerGroup.js +1 -1
  119. package/src/resources/index.js +36 -35
  120. package/dist/bundle.browser.js.map +0 -1
  121. package/dist/bundle.browser.min.js.map +0 -1
  122. package/dist/bundle.js.map +0 -1
  123. package/dist/bundle.min.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceBase.d.ts","sourceRoot":"","sources":["../../../src/resources/base/ResourceBase.js"],"names":[],"mappings":"AA6CA;;;GAGG;AACH;IAoFE;;;OAGG;IACH,kCAEC;IAED;;;;OAIG;IACH,kCAEC;IAED;;;OAGG;IACH,oCAEC;IAED;;;;OAIG;IACH,iDAEC;IAED;;;OAGG;IACH,+BAEC;IA3HD;;;OAGG;IACH,iBAHW,UAAU,cA4DpB;IAUD;;;OAGG;IACH,yBAMC;IAlBD;;;OAGG;IACH,sBAEC;IAnCC,qBAAiC;IACjC,gBAAqB;IACrB,iBAAe;IAwBf,uBAA+D;IAiEjE;;;OAGG;IACH,oCA2BC;IAED;;;;;OAKG;IACH,iBAIC;IAED;;;OAGG;IACH,eAFW,MAAM,MAAM,CAAC,GAAC,MAAM,GAAC,IAAI,QAenC;IAED;;;OAGG;IACH,SAFa,YAAY,CAYxB;IAED;;;;;OAKG;IACH,+DAaC;IAED;;;;OAIG;IACH,uBAwBC;IAED;;;;;;OAMG;IACH,2BALW,MAAM,mBAahB;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,kBAWC;IAJG,aAAe;IAMnB;;;OAGG;IACH,sBAIC;IAED;;;OAGG;IACH,2BAOC;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,yBAHW,OAAO,GACL,EAAE,CAoBd;IAED;;;;;;;OAOG;IACH,qCANW,MAAM,sBAAoB,kCAE1B,MAAM,GACJ,mBAAmB,CAa/B;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAlBW,MAAM,QAAM;YAEL,MAAM;QACX,mBAAmB,CA2C/B;CACF"}
@@ -0,0 +1,45 @@
1
+ export { default as Choropleth } from "./Choropleth";
2
+ export { default as Color } from "./Color";
3
+ export { default as Contract } from "./Contract";
4
+ export { default as Dimension } from "./Dimension";
5
+ export { default as DimensionSet } from "./DimensionSet";
6
+ export { default as Domain } from "./Domain";
7
+ export { default as Faq } from "./Faq";
8
+ export { default as Feature } from "./Feature";
9
+ export { default as Font } from "./Font";
10
+ export { default as FontFamily } from "./FontFamily";
11
+ export { default as Highlight } from "./Highlight";
12
+ export { default as InsetMap } from "./InsetMap";
13
+ export { default as Job } from "./Job";
14
+ export { default as JobResult } from "./JobResult";
15
+ export { default as JobRevision } from "./JobRevision";
16
+ export { default as JobShare } from "./JobShare";
17
+ export { default as JobType } from "./JobType";
18
+ export { default as Language } from "./Language";
19
+ export { default as Layer } from "./Layer";
20
+ export { default as LayerFaq } from "./LayerFaq";
21
+ export { default as Mapstyle } from "./Mapstyle";
22
+ export { default as MapstyleSet } from "./MapstyleSet";
23
+ export { default as Message } from "./Message";
24
+ export { default as Notification } from "./Notification";
25
+ export { default as Organisation } from "./Organisation";
26
+ export { default as Permission } from "./Permission";
27
+ export { default as ProductTour } from "./ProductTour";
28
+ export { default as ProductTourStep } from "./ProductTourStep";
29
+ export { default as Role } from "./Role";
30
+ export { default as Svg } from "./Svg";
31
+ export { default as SvgSet } from "./SvgSet";
32
+ export { default as Tag } from "./Tag";
33
+ export { default as TagType } from "./TagType";
34
+ export { default as User } from "./User";
35
+ export { default as VectorHighlight } from "./VectorHighlight";
36
+ export { default as VectorChoropleth } from "./VectorChoropleth";
37
+ export namespace base {
38
+ export { CrudBase };
39
+ export { CrudSetBase };
40
+ export { ResourceBase };
41
+ }
42
+ import CrudBase from "./base/CrudBase";
43
+ import CrudSetBase from "./base/CrudSetBase";
44
+ import ResourceBase from "./base/ResourceBase";
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @private
3
+ * @todo fix
4
+ */
5
+ export default class CookiesDriver extends DataStoreContract {
6
+ constructor(prefix?: string);
7
+ __prefix: string;
8
+ /**
9
+ * Cookie name prefix
10
+ * @returns {String} - Prefix
11
+ * @private
12
+ */
13
+ private get _prefix();
14
+ /**
15
+ * Store a value in the storage
16
+ * @param {String} name - value name
17
+ * @param {*} value - value
18
+ * @param {Date|String} [expires=2050-01-01] - Expiration date
19
+ */
20
+ set(name: string, value: any, expires?: Date | string): void;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ get(name: any): any;
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ remove(name: any): void;
29
+ /**
30
+ * Extract cookies and turn them into a object
31
+ * @returns {Object} - cookies
32
+ * @private
33
+ */
34
+ private _toObject;
35
+ }
36
+ import DataStoreContract from "./DataStoreContract";
37
+ //# sourceMappingURL=CookiesDriver.d.ts.map
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @private
3
+ */
4
+ export default class DataStoreContract {
5
+ /**
6
+ * If the driver is currently available
7
+ * @returns {boolean} - Driver availability
8
+ */
9
+ static get available(): boolean;
10
+ /**
11
+ * If the storage is secure
12
+ * @returns {boolean} - Secure storage
13
+ */
14
+ static get secure(): boolean;
15
+ /**
16
+ * Store a value in the storage
17
+ * @param {String} name - value name
18
+ * @param {*} value - value
19
+ * @abstract
20
+ */
21
+ set(name: string, value: any): void;
22
+ /**
23
+ * Get a value from the store
24
+ * @param {String} name - value name
25
+ * @returns {String} - value
26
+ * @abstract
27
+ */
28
+ get(name: string): string;
29
+ /**
30
+ * Remove a value from the store
31
+ * @param {String} name - value name
32
+ * @abstract
33
+ */
34
+ remove(name: string): void;
35
+ /**
36
+ * Clear storage
37
+ */
38
+ clear(): void;
39
+ /**
40
+ * Storage keys
41
+ * @returns {Array<String>} - Stored keys
42
+ * @abstract
43
+ */
44
+ keys(): Array<string>;
45
+ }
46
+ //# sourceMappingURL=DataStoreContract.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Used for storing data during tests
3
+ * @private
4
+ */
5
+ export default class DummyDriver extends DataStoreContract {
6
+ static _data: {};
7
+ /**
8
+ * Get a value from the store
9
+ * @param {String} name - value name
10
+ * @returns {*} - value
11
+ */
12
+ get(name: string): any;
13
+ }
14
+ import DataStoreContract from "./DataStoreContract";
15
+ //# sourceMappingURL=DummyDriver.d.ts.map
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @private
3
+ */
4
+ export default class FileDriver extends DataStoreContract {
5
+ /**
6
+ * @param {String} path - File storage path
7
+ * @inheritDoc
8
+ */
9
+ constructor(path?: string);
10
+ _path: string;
11
+ /**
12
+ * File storage path
13
+ * @param {String} value - path
14
+ */
15
+ set path(arg: string);
16
+ /**
17
+ * File storage path
18
+ * @returns {String} - path
19
+ */
20
+ get path(): string;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ set(name: any, value: any): void;
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ get(name: any): any;
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ remove(name: any): void;
33
+ /**
34
+ * Read file and parse
35
+ * @returns {Object<String, String>} - Key, value object
36
+ * @private
37
+ */
38
+ private _read;
39
+ /**
40
+ * Write data to file
41
+ * @param {Object<String, String>} obj - Key, value object
42
+ * @private
43
+ */
44
+ private _write;
45
+ /**
46
+ * Get fs instance
47
+ * @returns {fs} - fs instance
48
+ * @private
49
+ */
50
+ private get _fs();
51
+ __fs: any;
52
+ }
53
+ import DataStoreContract from "./DataStoreContract";
54
+ //# sourceMappingURL=FileDriver.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @private
3
+ */
4
+ export default class LocalStorageDriver extends DataStoreContract {
5
+ /**
6
+ * LocalStorage name prefix
7
+ * @returns {String} - Prefix
8
+ * @private
9
+ */
10
+ private static get _prefix();
11
+ }
12
+ import DataStoreContract from "./DataStoreContract";
13
+ //# sourceMappingURL=LocalStorageDriver.d.ts.map
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @private
3
+ */
4
+ export default class StorageManager extends StaticClass {
5
+ /**
6
+ * Available storage drivers
7
+ * @returns {Array.<function>} - Available storage drivers
8
+ */
9
+ static get available(): Function[];
10
+ /**
11
+ * Get LocalStorageDriver instance
12
+ * @returns {LocalStorageDriver} - Instance
13
+ */
14
+ static get localStorage(): LocalStorageDriver;
15
+ /**
16
+ * Get CookiesDriver instance
17
+ * @returns {CookiesDriver} - Instance
18
+ */
19
+ static get cookies(): CookiesDriver;
20
+ /**
21
+ * Get FileDriver instance
22
+ * @returns {FileDriver} - Instance
23
+ */
24
+ static get file(): FileDriver;
25
+ /**
26
+ * Get DummyDriver instance
27
+ * @returns {DummyDriver} - Instance
28
+ */
29
+ static get dummy(): DummyDriver;
30
+ /**
31
+ * Returns the best available storage driver. For a secure driver use {@link StorageManager#secure}
32
+ * @returns {DataStoreContract} - Best available storage driver
33
+ */
34
+ static get best(): DataStoreContract;
35
+ /**
36
+ * Returns the a secure storage driver
37
+ * @returns {DataStoreContract} - Secure storage driver
38
+ */
39
+ static get secure(): DataStoreContract;
40
+ }
41
+ import StaticClass from "../utils/StaticClass";
42
+ import LocalStorageDriver from "./LocalStorageDriver";
43
+ import CookiesDriver from "./CookiesDriver";
44
+ import FileDriver from "./FileDriver";
45
+ import DummyDriver from "./DummyDriver";
46
+ //# sourceMappingURL=StorageManager.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Adds the imageHandler to a resource
3
+ *
4
+ * @mixin
5
+ */
6
+ export default class HandlesImages extends Trait {
7
+ /**
8
+ * Handler for item image management
9
+ * @returns {ImageHandler} - Image handler
10
+ */
11
+ get imageHandler(): ImageHandler;
12
+ }
13
+ import Trait from "./Trait";
14
+ import ImageHandler from "../ImageHandler";
15
+ //# sourceMappingURL=HandlesImages.d.ts.map
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Adds the possibility to inject proxies/methods
3
+ *
4
+ * @mixin
5
+ */
6
+ export default class Injectable extends Trait {
7
+ /**
8
+ * Inject a proxy property into future instances
9
+ *
10
+ * @param {string|object} name - Name of the property
11
+ * @param {function?} value - Either a resource or a function that returns a proxy
12
+ *
13
+ * @example
14
+ *
15
+ * Mapcreator.injectProxy({Domain});
16
+ *
17
+ * // After creating new api instance
18
+ *
19
+ * api.domains // returns proxy
20
+ */
21
+ static injectProxy(name: string | object, value: Function | null): void;
22
+ /**
23
+ * Inject a property into future instances
24
+ *
25
+ * @param {string|object} name - Name of the property
26
+ * @param {function?} value - Any function that does not return a proxy
27
+ *
28
+ */
29
+ static inject(name: string | object, value: Function | null): void;
30
+ /**
31
+ * Prevent a property from being injected
32
+ * @param {string} name - Name of the property
33
+ */
34
+ static uninject(name: string): void;
35
+ /**
36
+ * Inject a proxy
37
+ * @param {string} name - Name of the property
38
+ * @param {function?} value - Either a resource or a function that returns a proxy
39
+ */
40
+ injectProxy(name: string, value: Function | null): void;
41
+ /**
42
+ * Inject a property into the instance
43
+ *
44
+ * @param {string|object} name - Name of the property
45
+ * @param {function?} value - Any function that does not return a proxy
46
+ *
47
+ */
48
+ inject(name: string | object, value: Function | null): void;
49
+ /**
50
+ * Revert a proxy injection in instance, won't delete non-injected properties
51
+ *
52
+ * @param {string} name - property name
53
+ * @throws Error when the property was not injected
54
+ */
55
+ uninject(name: string): void;
56
+ _injectProxy(name: any, value: any): void;
57
+ _inject(name: any, value: any, getter?: boolean): void;
58
+ }
59
+ import Trait from "./Trait";
60
+ //# sourceMappingURL=Injectable.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Provides a {@link ResourceBase} with functions for dealing with being ownable by an organisation
3
+ * @mixin
4
+ */
5
+ export default class OwnableResource extends Trait {
6
+ /**
7
+ * Get the list of associated organisations
8
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
9
+ */
10
+ get organisations(): SimpleResourceProxy;
11
+ /**
12
+ * If the resource can be owned by an organisation
13
+ * @returns {boolean} - Can be owned by an organisation
14
+ */
15
+ get ownable(): boolean;
16
+ }
17
+ import Trait from "./Trait";
18
+ //# sourceMappingURL=OwnableResource.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Trait interface
3
+ * @interface
4
+ * @mixin
5
+ */
6
+ export default class Trait {
7
+ /**
8
+ * Optional initialization method
9
+ */
10
+ initializer(): void;
11
+ }
12
+ //# sourceMappingURL=Trait.d.ts.map
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Simple logger implementation
3
+ */
4
+ export default class Logger {
5
+ /**
6
+ * Create a Logger instance
7
+ * @param {string} [logLevel=warn] - Log level
8
+ */
9
+ constructor(logLevel?: string);
10
+ /**
11
+ * Set the current log level
12
+ * @param {string} value - log level
13
+ * @throws {Logger#getLogLevels}
14
+ */
15
+ set logLevel(arg: string);
16
+ /**
17
+ * Get the current log level
18
+ * @returns {string} - log level
19
+ */
20
+ get logLevel(): string;
21
+ /**
22
+ * Get available log levels
23
+ * @returns {Array<string>} - Log levels
24
+ */
25
+ getLogLevels(): Array<string>;
26
+ /**
27
+ * Log a message
28
+ * @param {string} message - Message to be logged
29
+ * @param {string} level - Log level
30
+ */
31
+ log(message: string, level?: string): void;
32
+ /**
33
+ * Log a debug message
34
+ * @param {string} message - Message to be logged
35
+ */
36
+ debug(message: string): void;
37
+ /**
38
+ * Log an informative message
39
+ * @param {string} message - Message to be logged
40
+ */
41
+ info(message: string): void;
42
+ /**
43
+ * Log a warning message
44
+ * @param {string} message - Message to be logged
45
+ */
46
+ warn(message: string): void;
47
+ /**
48
+ * Log an error message
49
+ * @param {string} message - Message to be logged
50
+ */
51
+ error(message: string): void;
52
+ _logLevel: string;
53
+ _shouldLog(level: any): boolean;
54
+ }
55
+ //# sourceMappingURL=Logger.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Singletons will always return the same instance
3
+ *
4
+ * @private
5
+ */
6
+ export default class Singleton {
7
+ _instanceCount: number;
8
+ }
9
+ //# sourceMappingURL=Singleton.d.ts.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Disables the constructor and throws a {@link StaticClassError} when an instance is created.
3
+ * @protected
4
+ */
5
+ export default class StaticClass {
6
+ }
7
+ //# sourceMappingURL=StaticClass.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Makes an object and it's children unobservable by frameworks like Vuejs
3
+ * @protected
4
+ */
5
+ export default class Unobservable {
6
+ /**
7
+ * Overrides the `Object.prototype.toString.call(obj)` result
8
+ * @returns {string} - type name
9
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag
10
+ */
11
+ get [Symbol.toStringTag](): string;
12
+ }
13
+ //# sourceMappingURL=Unobservable.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Base64 encode data
3
+ *
4
+ * @param {Buffer|ArrayBuffer} buffer - input buffer
5
+ * @author Jon Leighton
6
+ * @license MIT
7
+ * @see https://gist.github.com/jonleighton/958841
8
+ * @returns {string} - base 64 encoded data
9
+ * @private
10
+ */
11
+ export function base64Encode(buffer: Buffer | ArrayBuffer): string;
12
+ //# sourceMappingURL=base64.d.ts.map
@@ -0,0 +1,74 @@
1
+ /**
2
+ * A geographical point
3
+ */
4
+ export class GeoPoint {
5
+ /**
6
+ * Geographical point
7
+ * @param {Number} lat - latitude
8
+ * @param {Number} lng - longitude
9
+ */
10
+ constructor(lat: number, lng: number);
11
+ /**
12
+ * Set latitude
13
+ * @param {Number} value - latitude
14
+ */
15
+ set lat(arg: number);
16
+ /**
17
+ * Get latitude
18
+ * @returns {Number} - latitude
19
+ */
20
+ get lat(): number;
21
+ /**
22
+ * Set longitude
23
+ * @param {Number} value - longitude
24
+ */
25
+ set lng(arg: number);
26
+ /**
27
+ * Get longitude
28
+ * @returns {Number} - longitude
29
+ */
30
+ get lng(): number;
31
+ _lat: number;
32
+ _lng: number;
33
+ /**
34
+ * Get data to be JSON encoded
35
+ * @returns {{lat: Number, lng: Number}} - data
36
+ */
37
+ toJSON(): {
38
+ lat: number;
39
+ lng: number;
40
+ };
41
+ }
42
+ /**
43
+ * Geometric boundary
44
+ */
45
+ export class GeoBoundary {
46
+ /**
47
+ * Geometric boundary
48
+ * @param {Object} topLeft - top left corner of the boundary
49
+ * @param {Number} topLeft.lat - top left corner latitude
50
+ * @param {Number} topLeft.lng - top left corner longitude
51
+ * @param {Object} bottomRight - bottom right corner of the boundary
52
+ * @param {Number} bottomRight.lat - bottom right corner latitude
53
+ * @param {Number} bottomRight.lng - bottom right corner longitude
54
+ */
55
+ constructor({ lat: lat1, lng: lng1 }: {
56
+ lat: number;
57
+ lng: number;
58
+ }, { lat: lat2, lng: lng2 }: {
59
+ lat: number;
60
+ lng: number;
61
+ });
62
+ /**
63
+ * Top left coordinate
64
+ * @type {GeoPoint}
65
+ */
66
+ topLeft: GeoPoint;
67
+ /**
68
+ * Bottom right coordinate
69
+ * @type {GeoPoint}
70
+ */
71
+ bottomRight: GeoPoint;
72
+ getCenter(): GeoPoint;
73
+ }
74
+ //# sourceMappingURL=geo.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Fast hash function for non-cryptographic use
3
+ * @param {string} str - Input to be hashed
4
+ * @returns {string} - String representation of the hash
5
+ * @private
6
+ */
7
+ export function fnv32b(str: string): string;
8
+ /**
9
+ * Fast object hashing for non-cryptographic use
10
+ * @param {object} data - input data
11
+ * @returns {string} - String reprisentation of the hash
12
+ * @private
13
+ */
14
+ export function hashObject(data: object): string;
15
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Get all the pages from a {@link PaginatedResourceListing} or a range
3
+ * @param {Promise<PaginatedResourceListing>|PaginatedResourceListing} page - Promise that returns a {@link PaginatedResourceListing}
4
+ * @param {?Number} [start=1] - Start page
5
+ * @param {?Number} [stop] - Stop page, defaults to the page count if not filled in.
6
+ * @returns {Promise<Array<ResourceBase>>} - multiple pages
7
+ * @throws {ApiError} - If the api returns errors
8
+ * @example
9
+ * import { helpers } from "@mapcreator/api";
10
+ *
11
+ * const promise = api.users.list(1, 50); // 50 per page is more efficient
12
+ *
13
+ * helpers.getPaginatedRange(promise).then(data => {
14
+ * data.map(row => `[${row.id}] ${row.name}`) // We just want the names
15
+ * .forEach(console.log) // Log the names and ids of every user
16
+ * })
17
+ */
18
+ export function getPaginatedRange(page: Promise<PaginatedResourceListing> | PaginatedResourceListing, start?: number | null, stop?: number | null): Promise<Array<ResourceBase>>;
19
+ /**
20
+ * Wraps around ky to make it return cancelable requests
21
+ * @param {function(*=, *=): Response} fn - ky instance
22
+ * @returns {function(*=, *=): Response}
23
+ * @private
24
+ */
25
+ export function wrapKyCancelable(fn: () => Response): () => Response;
26
+ /**
27
+ * @typedef {Promise} CancelablePromise
28
+ * @property {function(): void} cancel - Cancel the promise
29
+ */
30
+ /**
31
+ * Makes a promise cancelable by passing it a signal
32
+ * @param {function} fn - async method
33
+ * @returns {CancelablePromise}
34
+ * @private
35
+ */
36
+ export function makeCancelable(fn: Function): CancelablePromise;
37
+ /**
38
+ * Convert Date into server format
39
+ * @param {Date} date - Target
40
+ * @returns {String} - Formatted date
41
+ * @private
42
+ */
43
+ export function serializeUTCDate(date: Date): string;
44
+ export function clone(input: any, clonePrivate?: boolean): any;
45
+ export function delay(ms: number): Promise<any>;
46
+ export type CancelablePromise = Promise<any>;
47
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Test if the application is running under nodejs
3
+ * @returns {boolean} - Is the application running under node?
4
+ * @see https://nodejs.org
5
+ * @private
6
+ */
7
+ export function isNode(): boolean;
8
+ /**
9
+ * Quickly check if the window contains a variable
10
+ * @param {string} str - target variable
11
+ * @returns {boolean} - If the window contains the variable
12
+ * @private
13
+ */
14
+ export function windowTest(str: string): boolean;
15
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Tests if the parent is a parent of child
3
+ * @param {Class|object} parent - Instance or Class
4
+ * @param {Class|object} child - Instance or Class
5
+ * @returns {boolean} - is parent a parent of child
6
+ * @private
7
+ * @example
8
+ * class A {}
9
+ * class B extends A {}
10
+ * class C extends B {}
11
+ *
12
+ * isParentOf(A, C) // true
13
+ * isParentOf(B, C) // true
14
+ * isParentOf(C, C) // true
15
+ * isParentOf(B, A) // false
16
+ */
17
+ export function isParentOf(parent: Class | object, child: Class | object): boolean;
18
+ /**
19
+ * Get the name of the value type
20
+ * @param {*} value - Any value
21
+ * @private
22
+ * @returns {string} - Value type name
23
+ */
24
+ export function getTypeName(value: any): string;
25
+ /**
26
+ * Mix traits into the target class
27
+ * @param {Class} baseClass - Target base class for the traits to be applied to
28
+ * @param {Class<Trait>} mixins - Traits to be applied
29
+ * @returns {Class} - Constructor with any traits applied
30
+ * @private
31
+ */
32
+ export function mix(baseClass: Class, ...mixins: Class<Trait>): Class;
33
+ /**
34
+ * Checks if the target has a certain trait.
35
+ *
36
+ * @param {Class|Object} Subject - Instance or class
37
+ * @param {Class<Trait>} TraitClass - Trait to check for
38
+ * @returns {boolean} - If the subject has the trait
39
+ * @private
40
+ */
41
+ export function hasTrait(Subject: Class | any, TraitClass: Class<Trait>): boolean;
42
+ import Trait from "../traits/Trait";
43
+ //# sourceMappingURL=reflection.d.ts.map