@blueskyproject/tiled 0.0.31 → 0.0.32
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/app/App.d.ts.map +1 -1
- package/dist/components/Tiled/PreviewNDArray.d.ts.map +1 -1
- package/dist/components/Tiled/PreviewStructuredArray.d.ts.map +1 -1
- package/dist/components/Tiled/PreviewTable.d.ts.map +1 -1
- package/dist/components/Tiled/PreviewXArray.d.ts.map +1 -1
- package/dist/components/Tiled/api/TiledApiClient.d.ts +228 -0
- package/dist/components/Tiled/api/TiledApiClient.d.ts.map +1 -0
- package/dist/components/Tiled/api/TiledArrayApi.d.ts +192 -0
- package/dist/components/Tiled/api/TiledArrayApi.d.ts.map +1 -0
- package/dist/components/Tiled/api/TiledClientTest.d.ts +2 -0
- package/dist/components/Tiled/api/TiledClientTest.d.ts.map +1 -0
- package/dist/components/Tiled/api/TiledConfigApi.d.ts +60 -0
- package/dist/components/Tiled/api/TiledConfigApi.d.ts.map +1 -0
- package/dist/components/Tiled/api/TiledFinchApi.d.ts +8 -0
- package/dist/components/Tiled/api/TiledFinchApi.d.ts.map +1 -0
- package/dist/components/Tiled/api/TiledInfoApi.d.ts +6 -0
- package/dist/components/Tiled/api/TiledInfoApi.d.ts.map +1 -0
- package/dist/components/Tiled/api/TiledMetadataApi.d.ts +6 -0
- package/dist/components/Tiled/api/TiledMetadataApi.d.ts.map +1 -0
- package/dist/components/Tiled/api/TiledSearchApi.d.ts +171 -0
- package/dist/components/Tiled/api/TiledSearchApi.d.ts.map +1 -0
- package/dist/components/Tiled/api/TiledTableApi.d.ts +89 -0
- package/dist/components/Tiled/api/TiledTableApi.d.ts.map +1 -0
- package/dist/components/Tiled/api/defaultTiledApiClient.d.ts +315 -0
- package/dist/components/Tiled/api/defaultTiledApiClient.d.ts.map +1 -0
- package/dist/components/Tiled/{apiClient.d.ts → archived_apiClient.d.ts} +9 -10
- package/dist/components/Tiled/archived_apiClient.d.ts.map +1 -0
- package/dist/components/Tiled/useTiled.d.ts.map +1 -1
- package/dist/components/Tiled/utils.d.ts +7 -0
- package/dist/components/Tiled/utils.d.ts.map +1 -1
- package/dist/index.d.ts +15 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/mockServiceWorker.js +1 -1
- package/dist/tiled.css +1 -1
- package/dist/tiled.es.js +12908 -13204
- package/dist/tiled.umd.js +51 -51
- package/package.json +1 -1
- package/dist/components/Tiled/apiClient.d.ts.map +0 -1
package/dist/app/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/app/App.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/app/App.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAQnB,iBAAS,GAAG,4CAsEX;AAED,eAAe,GAAG,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewNDArray.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/PreviewNDArray.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAU,MAAM,SAAS,CAAC;AAMlE,KAAK,mBAAmB,GAAG;IACvB,SAAS,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC/F,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACnC,SAAS,EACT,GAAG,EACH,WAAW,EACX,iBAAiB,EACpB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"PreviewNDArray.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/PreviewNDArray.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAU,MAAM,SAAS,CAAC;AAMlE,KAAK,mBAAmB,GAAG;IACvB,SAAS,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC/F,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACnC,SAAS,EACT,GAAG,EACH,WAAW,EACX,iBAAiB,EACpB,EAAE,mBAAmB,2CA+ErB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewStructuredArray.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/PreviewStructuredArray.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAA4B,MAAM,SAAS,CAAC;AAO9F,KAAK,2BAA2B,GAAG;IAC/B,mBAAmB,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAC;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,mBAAmB,EAAE,GAAG,EAAE,EAAE,2BAA2B,
|
|
1
|
+
{"version":3,"file":"PreviewStructuredArray.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/PreviewStructuredArray.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAA4B,MAAM,SAAS,CAAC;AAO9F,KAAK,2BAA2B,GAAG;IAC/B,mBAAmB,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAC;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,mBAAmB,EAAE,GAAG,EAAE,EAAE,2BAA2B,2CAuHvG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewTable.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/PreviewTable.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAiB,MAAM,SAAS,CAAC;AAQzE,KAAK,iBAAiB,GAAG;IACrB,SAAS,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"PreviewTable.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/PreviewTable.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAiB,MAAM,SAAS,CAAC;AAQzE,KAAK,iBAAiB,GAAG;IACrB,SAAS,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,iBAAiB,2CAwHzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewXArray.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/PreviewXArray.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAK1E,KAAK,kBAAkB,GAAG;IACtB,UAAU,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"PreviewXArray.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/PreviewXArray.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAK1E,KAAK,kBAAkB,GAAG;IACtB,UAAU,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,kBAAkB,2CAmH5E"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { FinchTiledApi } from './TiledFinchApi';
|
|
3
|
+
import { TiledArrayReturnType, TiledArrayReturnMap, GetArrayAsOptionsMap } from './TiledArrayApi';
|
|
4
|
+
import { GetTableAsOptionsMap, TiledTableReturnMap, TiledTableReturnType, TiledTableEndpoint, TiledTableJSONResponse } from './TiledTableApi';
|
|
5
|
+
import { TiledSearchConfig } from './TiledSearchApi';
|
|
6
|
+
import { TiledRequestOptions } from './TiledConfigApi';
|
|
7
|
+
import { TiledTableRow, TiledSearchItem, TiledStructures, TiledSearchResult, TiledInfoResponse, TiledAuthProvider } from '../types';
|
|
8
|
+
type GetTableAsJSONOptions = GetTableAsOptionsMap['JSON'];
|
|
9
|
+
type GetTableAsJSONSequenceOptions = GetTableAsOptionsMap['JSON_SEQ'];
|
|
10
|
+
type AuthErrorCallback = (error: unknown) => void;
|
|
11
|
+
export type TiledApiClientConfig = {
|
|
12
|
+
client?: AxiosInstance;
|
|
13
|
+
baseUrl?: string;
|
|
14
|
+
initialPath?: string;
|
|
15
|
+
apiKey?: string | null;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
maxArrayBytes?: number;
|
|
18
|
+
onAuthError?: AuthErrorCallback;
|
|
19
|
+
};
|
|
20
|
+
export declare class TiledApiClient implements FinchTiledApi {
|
|
21
|
+
private client;
|
|
22
|
+
private baseUrl;
|
|
23
|
+
private initialPath;
|
|
24
|
+
private apiKey;
|
|
25
|
+
private signal;
|
|
26
|
+
private maxArrayBytes;
|
|
27
|
+
private authErrorCallback;
|
|
28
|
+
private refreshPromise;
|
|
29
|
+
constructor(config?: TiledApiClientConfig);
|
|
30
|
+
/**
|
|
31
|
+
* Sets the Tiled server base URL and updates the underlying Axios instance.
|
|
32
|
+
* Must include the API version segment, e.g. `"https://server.example.com/api/v1"`.
|
|
33
|
+
* @param baseUrl - Full server base URL.
|
|
34
|
+
*/
|
|
35
|
+
setBaseUrl(baseUrl: string): void;
|
|
36
|
+
/** Returns the current base URL. */
|
|
37
|
+
getBaseUrl(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Sets the initial path prefix prepended to all relative request paths.
|
|
40
|
+
* Leading/trailing slashes are normalised automatically.
|
|
41
|
+
* @param initialPath - Path prefix, e.g. `"data/project"`.
|
|
42
|
+
*/
|
|
43
|
+
setInitialPath(initialPath: string): void;
|
|
44
|
+
/** Returns the current initial path prefix. */
|
|
45
|
+
getInitialPath(): string;
|
|
46
|
+
/**
|
|
47
|
+
* Sets the API key. The request interceptor attaches it as
|
|
48
|
+
* `Authorization: ApiKey <key>` to every request without an existing
|
|
49
|
+
* `Authorization` header.
|
|
50
|
+
* @param apiKey - API key string, or `null` to clear it.
|
|
51
|
+
*/
|
|
52
|
+
setApiKey(apiKey: string | null): void;
|
|
53
|
+
/** Returns the current API key, or `null` if none is set. */
|
|
54
|
+
getApiKey(): string | null;
|
|
55
|
+
/** Returns the underlying Axios instance for low-level configuration. */
|
|
56
|
+
getAxiosClient(): AxiosInstance;
|
|
57
|
+
/**
|
|
58
|
+
* Sets a default `AbortSignal` applied to every request made by this client.
|
|
59
|
+
* @param signal - An `AbortSignal`, or `undefined` to clear it.
|
|
60
|
+
*/
|
|
61
|
+
setSignal(signal: AbortSignal | undefined): void;
|
|
62
|
+
/** Returns the current default abort signal, or `undefined` if none is set. */
|
|
63
|
+
getSignal(): AbortSignal | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Sets a global maximum payload size for array requests.
|
|
66
|
+
* When set, the client auto-computes a downsample step so the payload stays
|
|
67
|
+
* under this byte limit. Per-request `maxBytesAllowed` still takes precedence.
|
|
68
|
+
* @param maxArrayBytes - Byte limit, or `undefined` to disable.
|
|
69
|
+
*/
|
|
70
|
+
setMaxArrayBytes(maxArrayBytes: number | undefined): void;
|
|
71
|
+
/** Returns the current global max array bytes limit, or `undefined` if none. */
|
|
72
|
+
getMaxArrayBytes(): number | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Registers a callback invoked when a token-refresh attempt fails.
|
|
75
|
+
* Use this to show a login prompt or redirect the user.
|
|
76
|
+
* @param callback - Function called with the error (or `null` if no stored tokens),
|
|
77
|
+
* or `undefined` to clear any existing callback.
|
|
78
|
+
*/
|
|
79
|
+
setAuthErrorCallback(callback: AuthErrorCallback | undefined): void;
|
|
80
|
+
/**
|
|
81
|
+
* Sets or clears the bearer token on the Axios instance.
|
|
82
|
+
* Once set, all requests include `Authorization: Bearer <token>`.
|
|
83
|
+
* @param token - Bearer token string, or `null` to remove the header.
|
|
84
|
+
*/
|
|
85
|
+
setBearerToken(token: string | null): void;
|
|
86
|
+
private doTokenRefresh;
|
|
87
|
+
private resolveArrayOptions;
|
|
88
|
+
/**
|
|
89
|
+
* Generic array dispatcher. Fetches the array in the specified format and
|
|
90
|
+
* returns the strongly-typed result.
|
|
91
|
+
*
|
|
92
|
+
* Prefer the typed helpers (`getArrayAsJSON`, `getArrayAsPng`, etc.) for
|
|
93
|
+
* cleaner call sites.
|
|
94
|
+
*
|
|
95
|
+
* @param arrayPath - Tiled path to the array.
|
|
96
|
+
* @param type - Output format: `'JSON'`, `'PNG'`, `'BUFFER'`, or `'IMAGE_PATH'`.
|
|
97
|
+
* @param options - Format-specific options.
|
|
98
|
+
* @returns A promise resolving to the array data in the requested format.
|
|
99
|
+
*/
|
|
100
|
+
getArrayAs<T extends TiledArrayReturnType>(arrayPath: string, type: T, options?: GetArrayAsOptionsMap[T]): Promise<TiledArrayReturnMap[T]>;
|
|
101
|
+
/**
|
|
102
|
+
* Fetches a Tiled array as JSON data.
|
|
103
|
+
* @param arrayPath - Tiled path to the array.
|
|
104
|
+
* @param options - Array request options (stack, downsampling, maxBytesAllowed, etc.).
|
|
105
|
+
* @returns A promise resolving to the array data. Defaults to `number[][]`.
|
|
106
|
+
*/
|
|
107
|
+
getArrayAsJSON<T = number[][]>(arrayPath: string, options?: GetArrayAsOptionsMap['JSON']): Promise<T>;
|
|
108
|
+
/**
|
|
109
|
+
* Fetches a Tiled array as a PNG `Blob`.
|
|
110
|
+
* @param arrayPath - Tiled path to the array.
|
|
111
|
+
* @param options - Array request options (stack, downsampling, etc.).
|
|
112
|
+
* @returns A promise resolving to a PNG `Blob`.
|
|
113
|
+
*/
|
|
114
|
+
getArrayAsPng(arrayPath: string, options?: GetArrayAsOptionsMap['PNG']): Promise<Blob>;
|
|
115
|
+
/**
|
|
116
|
+
* Fetches a Tiled array as a raw `ArrayBuffer`.
|
|
117
|
+
* @param arrayPath - Tiled path to the array.
|
|
118
|
+
* @param options - Array request options.
|
|
119
|
+
* @returns A promise resolving to an `ArrayBuffer` of raw bytes.
|
|
120
|
+
*/
|
|
121
|
+
getArrayAsBuffer(arrayPath: string, options?: GetArrayAsOptionsMap['BUFFER']): Promise<ArrayBuffer>;
|
|
122
|
+
/**
|
|
123
|
+
* Builds and returns a full URL for a Tiled array image without making a
|
|
124
|
+
* network request. Suitable for use directly as an `<img src>` attribute.
|
|
125
|
+
*
|
|
126
|
+
* This method is synchronous and uses structure already present in `options`
|
|
127
|
+
* — it does not fetch metadata from the server.
|
|
128
|
+
*
|
|
129
|
+
* @param arrayPath - Tiled path to the array.
|
|
130
|
+
* @param options - Array request options (stack, format, downsampling, etc.).
|
|
131
|
+
* @returns A URL string pointing to the array image endpoint.
|
|
132
|
+
*/
|
|
133
|
+
getArrayAsImagePath(arrayPath: string, options?: GetArrayAsOptionsMap['IMAGE_PATH']): string;
|
|
134
|
+
/**
|
|
135
|
+
* Fetches Tiled item metadata for the given path.
|
|
136
|
+
* Returns the `TiledSearchItem` directly (not a `{ data, error }` wrapper).
|
|
137
|
+
* @param path - Tiled path to the item.
|
|
138
|
+
* @param options - Per-request options (baseUrl override, pathMode, etc.).
|
|
139
|
+
* @returns A promise resolving to the typed `TiledSearchItem`.
|
|
140
|
+
*/
|
|
141
|
+
getMetadata<S extends TiledStructures = TiledStructures>(path: string, options?: TiledRequestOptions): Promise<TiledSearchItem<S>>;
|
|
142
|
+
/**
|
|
143
|
+
* Generic table dispatcher. Fetches the table in the specified format and
|
|
144
|
+
* endpoint variant. Prefer the typed helpers for cleaner call sites.
|
|
145
|
+
* @param tablePath - Tiled path to the table.
|
|
146
|
+
* @param type - `'JSON'` for column-oriented or `'JSON_SEQ'` for row-oriented.
|
|
147
|
+
* @param endpoint - `'partition'` (single partition) or `'full'` (all partitions).
|
|
148
|
+
* @param options - Table request options.
|
|
149
|
+
* @returns A promise resolving to the table data.
|
|
150
|
+
*/
|
|
151
|
+
getTableAs<T extends TiledTableReturnType>(tablePath: string, type?: T, endpoint?: TiledTableEndpoint, options?: GetTableAsOptionsMap[T]): Promise<TiledTableReturnMap[T]>;
|
|
152
|
+
/**
|
|
153
|
+
* Fetches a single partition of a Tiled table as column-oriented JSON.
|
|
154
|
+
* @param tablePath - Tiled path to the table.
|
|
155
|
+
* @param options - Options including `partition` index (defaults to `0`).
|
|
156
|
+
* @returns A promise resolving to a `Record<columnName, values[]>` object.
|
|
157
|
+
*/
|
|
158
|
+
getTablePartitionAsJSON(tablePath: string, options?: GetTableAsJSONOptions): Promise<TiledTableJSONResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* Fetches a single partition of a Tiled table as row-oriented JSON sequence.
|
|
161
|
+
* @param tablePath - Tiled path to the table.
|
|
162
|
+
* @param options - Options including `partition` index (defaults to `0`).
|
|
163
|
+
* @returns A promise resolving to an array of row objects.
|
|
164
|
+
*/
|
|
165
|
+
getTablePartitionAsJSONSequence(tablePath: string, options?: GetTableAsJSONSequenceOptions): Promise<TiledTableRow[]>;
|
|
166
|
+
/**
|
|
167
|
+
* Fetches the full (all partitions) Tiled table as column-oriented JSON.
|
|
168
|
+
* @param tablePath - Tiled path to the table.
|
|
169
|
+
* @param options - Table request options.
|
|
170
|
+
* @returns A promise resolving to a `Record<columnName, values[]>` object.
|
|
171
|
+
*/
|
|
172
|
+
getTableFullAsJSON(tablePath: string, options?: GetTableAsJSONOptions): Promise<TiledTableJSONResponse>;
|
|
173
|
+
/**
|
|
174
|
+
* Fetches the full (all partitions) Tiled table as row-oriented JSON sequence.
|
|
175
|
+
* @param tablePath - Tiled path to the table.
|
|
176
|
+
* @param options - Table request options.
|
|
177
|
+
* @returns A promise resolving to an array of row objects.
|
|
178
|
+
*/
|
|
179
|
+
getTableFullAsJSONSequence(tablePath: string, options?: GetTableAsJSONSequenceOptions): Promise<TiledTableRow[]>;
|
|
180
|
+
private get;
|
|
181
|
+
private resolveClient;
|
|
182
|
+
private resolveBaseUrl;
|
|
183
|
+
private resolveArrayFullEndpoint;
|
|
184
|
+
private resolveArrayBlockEndpoint;
|
|
185
|
+
/**
|
|
186
|
+
* Fetches Tiled server information (auth providers, version, etc.).
|
|
187
|
+
* Returns `null` if the server is unreachable or the response is malformed.
|
|
188
|
+
* @param options - Per-request options (e.g. `baseUrl` override).
|
|
189
|
+
* @returns A promise resolving to `TiledInfoResponse` or `null`.
|
|
190
|
+
*/
|
|
191
|
+
getServerInfo(options?: TiledRequestOptions): Promise<TiledInfoResponse | null>;
|
|
192
|
+
/**
|
|
193
|
+
* Performs a Tiled search at the given path with optional filters and options.
|
|
194
|
+
* @param searchPath - Container path to search within (empty string for root).
|
|
195
|
+
* @param config - Search configuration: `searchFilters` and `searchOptions`.
|
|
196
|
+
* @param requestOptions - Per-request HTTP options (baseUrl, initialPath, etc.).
|
|
197
|
+
* @returns A promise resolving to a `TiledSearchResult` with paginated items.
|
|
198
|
+
*/
|
|
199
|
+
getSearch(searchPath: string, config?: TiledSearchConfig, requestOptions?: TiledRequestOptions): Promise<TiledSearchResult>;
|
|
200
|
+
private resolveSearchEndpoint;
|
|
201
|
+
private makeStructureFetcher;
|
|
202
|
+
private resolveMetadataEndpoint;
|
|
203
|
+
private resolveTableFullEndpoint;
|
|
204
|
+
private resolveTablePartitionEndpoint;
|
|
205
|
+
/**
|
|
206
|
+
* Authenticates with the Tiled server using a username and password.
|
|
207
|
+
*
|
|
208
|
+
* Resolves the auth endpoint from `provider.links.auth_endpoint` or, if no
|
|
209
|
+
* provider is given, from the first password/internal provider in server info.
|
|
210
|
+
* On success, saves tokens to localStorage and sets the bearer token on this
|
|
211
|
+
* client instance.
|
|
212
|
+
*
|
|
213
|
+
* @param username - The user's login name.
|
|
214
|
+
* @param password - The user's password.
|
|
215
|
+
* @param url - Optional server URL override. Defaults to this client's base URL.
|
|
216
|
+
* @param provider - Optional pre-fetched auth provider.
|
|
217
|
+
* @returns A promise resolving to `{ access_token, refresh_token }` on success,
|
|
218
|
+
* or `null` on failure.
|
|
219
|
+
*/
|
|
220
|
+
loginWithUsernamePassword(username: string, password: string, url?: string, provider?: TiledAuthProvider): Promise<{
|
|
221
|
+
access_token: string;
|
|
222
|
+
refresh_token: string;
|
|
223
|
+
} | null>;
|
|
224
|
+
private resolveEncodedPath;
|
|
225
|
+
private resolveTiledPath;
|
|
226
|
+
}
|
|
227
|
+
export {};
|
|
228
|
+
//# sourceMappingURL=TiledApiClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TiledApiClient.d.ts","sourceRoot":"","sources":["../../../../src/components/Tiled/api/TiledApiClient.ts"],"names":[],"mappings":"AACA,OAAc,EACZ,aAAa,EAGd,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,O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AAC,aAAa,EAAE,CAAC;YAWX,GAAG;IA2BjB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,yBAAyB;IAQjC;;;;;OAKG;IACG,aAAa,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAWzF;;;;;;OAMG;IACG,SAAS,CACb,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,iBAAsB,EAC9B,cAAc,GAAE,mBAAwB,GACvC,OAAO,CAAC,iBAAiB,CAAC;IAQ7B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,6BAA6B;IASrC;;;;;;;;;;;;;;OAcG;IACG,yBAAyB,CAC7B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAiDlE,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,gBAAgB;CAyBzB"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { TiledRequestOptions } from './TiledConfigApi';
|
|
2
|
+
import { ArrayStructure, TiledSearchItem } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* A Tiled search item whose structure is specifically an ArrayStructure.
|
|
5
|
+
*/
|
|
6
|
+
export type TiledArrayItem = TiledSearchItem<ArrayStructure>;
|
|
7
|
+
/**
|
|
8
|
+
* The supported output types for array reads.
|
|
9
|
+
*
|
|
10
|
+
* These describe the JavaScript return type, not necessarily the Tiled endpoint.
|
|
11
|
+
*/
|
|
12
|
+
export type TiledArrayReturnType = 'JSON' | 'PNG' | 'BUFFER' | 'IMAGE_PATH';
|
|
13
|
+
/**
|
|
14
|
+
* Maps each array output type to its TypeScript return type.
|
|
15
|
+
*/
|
|
16
|
+
export type TiledArrayReturnMap = {
|
|
17
|
+
JSON: number[][];
|
|
18
|
+
PNG: Blob;
|
|
19
|
+
BUFFER: ArrayBuffer;
|
|
20
|
+
IMAGE_PATH: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Shared options available to all Tiled array API calls.
|
|
24
|
+
*/
|
|
25
|
+
export interface TiledArrayRequestOptions extends TiledRequestOptions {
|
|
26
|
+
/**
|
|
27
|
+
* A simple ratio used to downsample the image.
|
|
28
|
+
*
|
|
29
|
+
* Example:
|
|
30
|
+
* - 1 = no downsampling
|
|
31
|
+
* - 2 = every other pixel
|
|
32
|
+
* - 4 = every fourth pixel
|
|
33
|
+
*/
|
|
34
|
+
downSampleRatio?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Maximum number of bytes allowed for the returned image/array payload.
|
|
37
|
+
*
|
|
38
|
+
* If provided, Finch computes an appropriate downsample ratio using
|
|
39
|
+
* array structure information such as shape and dtype item size.
|
|
40
|
+
*/
|
|
41
|
+
maxBytesAllowed?: number;
|
|
42
|
+
/**
|
|
43
|
+
* The stack/frame index to grab from a higher-dimensional array.
|
|
44
|
+
*
|
|
45
|
+
* Example:
|
|
46
|
+
* For an array shaped like [frames, height, width],
|
|
47
|
+
* stack: [5] means "grab frame 5".
|
|
48
|
+
*/
|
|
49
|
+
stack?: number[];
|
|
50
|
+
/**
|
|
51
|
+
* Array structure information from Tiled.
|
|
52
|
+
*
|
|
53
|
+
* This usually comes from:
|
|
54
|
+
*
|
|
55
|
+
* arrayItem.attributes.structure
|
|
56
|
+
*
|
|
57
|
+
* Passing this avoids a secondary metadata/structure request.
|
|
58
|
+
*/
|
|
59
|
+
structure?: ArrayStructure;
|
|
60
|
+
/**
|
|
61
|
+
* Full Tiled item for an array.
|
|
62
|
+
*
|
|
63
|
+
* Passing this can avoid a secondary metadata/structure request and also
|
|
64
|
+
* gives access to item-level attributes, links, specs, metadata, etc.
|
|
65
|
+
*/
|
|
66
|
+
arrayItem?: TiledArrayItem;
|
|
67
|
+
/**
|
|
68
|
+
* Use this when the image should be treated as RGB even though it is stored
|
|
69
|
+
* as a 3D array in Tiled.
|
|
70
|
+
*
|
|
71
|
+
* Example:
|
|
72
|
+
* [height, width, 3] should be treated as one RGB image, not as a stack
|
|
73
|
+
* of grayscale frames.
|
|
74
|
+
*/
|
|
75
|
+
isRGB?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Format-specific options for getArrayAs(...).
|
|
79
|
+
*/
|
|
80
|
+
export type GetArrayAsOptionsMap = {
|
|
81
|
+
JSON: TiledArrayRequestOptions & {
|
|
82
|
+
format?: 'application/json';
|
|
83
|
+
};
|
|
84
|
+
PNG: TiledArrayRequestOptions & {
|
|
85
|
+
format?: 'image/png';
|
|
86
|
+
};
|
|
87
|
+
BUFFER: TiledArrayRequestOptions & {
|
|
88
|
+
format?: 'application/octet-stream';
|
|
89
|
+
};
|
|
90
|
+
IMAGE_PATH: TiledArrayRequestOptions & {
|
|
91
|
+
format?: 'image/png' | 'image/tiff';
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Main array API interface.
|
|
96
|
+
*
|
|
97
|
+
* TiledApiClient should implement this.
|
|
98
|
+
* Tests can also mock this interface directly.
|
|
99
|
+
*/
|
|
100
|
+
export interface TiledArrayApi {
|
|
101
|
+
getArrayAs<T extends TiledArrayReturnType>(arrayPath: string, type: T, options?: GetArrayAsOptionsMap[T]): Promise<TiledArrayReturnMap[T]>;
|
|
102
|
+
getArrayAsJSON<T = number[][]>(arrayPath: string, options?: GetArrayAsOptionsMap['JSON']): Promise<T>;
|
|
103
|
+
getArrayAsPng(arrayPath: string, options?: GetArrayAsOptionsMap['PNG']): Promise<Blob>;
|
|
104
|
+
getArrayAsBuffer(arrayPath: string, options?: GetArrayAsOptionsMap['BUFFER']): Promise<ArrayBuffer>;
|
|
105
|
+
getArrayAsImagePath(arrayPath: string, options?: GetArrayAsOptionsMap['IMAGE_PATH']): string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Gets ArrayStructure from either options.structure or options.arrayItem.
|
|
109
|
+
*
|
|
110
|
+
* This helper is useful inside the real client implementation when deciding
|
|
111
|
+
* whether a secondary structure request is needed.
|
|
112
|
+
*/
|
|
113
|
+
export declare function resolveArrayStructure(options?: TiledArrayRequestOptions): ArrayStructure | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* True when the caller already provided enough array structure info for
|
|
116
|
+
* downsampling decisions.
|
|
117
|
+
*/
|
|
118
|
+
export declare function hasArrayStructure(options?: TiledArrayRequestOptions): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Computes the display dimensions (height, width, channels) for an array.
|
|
121
|
+
*
|
|
122
|
+
* For RGB arrays (`isRGB: true`), the last three dimensions are interpreted as
|
|
123
|
+
* `[height, width, channels]`. For all other arrays the last two dimensions are
|
|
124
|
+
* `[height, width]` with `channels = 1`.
|
|
125
|
+
*
|
|
126
|
+
* @param structure - The `ArrayStructure` from Tiled metadata.
|
|
127
|
+
* @param options - Array request options; `isRGB` affects channel interpretation.
|
|
128
|
+
* @returns An object with `height`, `width`, and `channels` numbers.
|
|
129
|
+
*/
|
|
130
|
+
export declare function getDisplayShape(structure: ArrayStructure, options?: TiledArrayRequestOptions): {
|
|
131
|
+
height: number;
|
|
132
|
+
width: number;
|
|
133
|
+
channels: number;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Callback used to fetch an ArrayStructure for a given path when none is
|
|
137
|
+
* available in options. Passed by TiledApiClient so TiledArrayApi stays
|
|
138
|
+
* free of import cycles.
|
|
139
|
+
*/
|
|
140
|
+
export type StructureFetcher = (path: string) => Promise<ArrayStructure | undefined>;
|
|
141
|
+
/**
|
|
142
|
+
* Computes downsample step sizes synchronously using any structure already
|
|
143
|
+
* present in `options`. Used by `getArrayAsImagePath` which cannot be async.
|
|
144
|
+
*
|
|
145
|
+
* When neither `downSampleRatio` nor array structure is available, returns
|
|
146
|
+
* `{ stepX: 1, stepY: 1 }` (no downsampling).
|
|
147
|
+
*
|
|
148
|
+
* @param options - Array request options, optionally containing structure info.
|
|
149
|
+
* @returns An object with integer `stepX` and `stepY` downsample steps.
|
|
150
|
+
*/
|
|
151
|
+
export declare function generateStepsForArray(options?: TiledArrayRequestOptions): {
|
|
152
|
+
stepX: number;
|
|
153
|
+
stepY: number;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Computes downsample step sizes, fetching array structure from the server
|
|
157
|
+
* when it is not already available in `options`.
|
|
158
|
+
*
|
|
159
|
+
* @param arrayPath - Tiled path to the array (used for the structure fetch).
|
|
160
|
+
* @param options - Array request options, optionally containing structure info.
|
|
161
|
+
* @param fetchStructure - Callback that fetches `ArrayStructure` for a path. If
|
|
162
|
+
* omitted or if the fetch throws, step sizes default to `{ stepX: 1, stepY: 1 }`.
|
|
163
|
+
* @returns A promise resolving to integer `stepX` and `stepY` downsample steps.
|
|
164
|
+
*/
|
|
165
|
+
export declare function generateStepsForArrayAsync(arrayPath: string, options?: TiledArrayRequestOptions, fetchStructure?: StructureFetcher): Promise<{
|
|
166
|
+
stepX: number;
|
|
167
|
+
stepY: number;
|
|
168
|
+
}>;
|
|
169
|
+
/**
|
|
170
|
+
* Builds the Tiled `slice` query-string parameter synchronously.
|
|
171
|
+
*
|
|
172
|
+
* Uses structure already present in `options`; does not fetch from the server.
|
|
173
|
+
* Prefer `buildTiledArraySliceAsync` when the caller can be async.
|
|
174
|
+
*
|
|
175
|
+
* @param options - Array request options used to compute step sizes and format the slice.
|
|
176
|
+
* @returns A slice string such as `"::2,::2"` or `"0,::4,::4"`.
|
|
177
|
+
*/
|
|
178
|
+
export declare function buildTiledArraySlice(options?: TiledArrayRequestOptions): string;
|
|
179
|
+
/**
|
|
180
|
+
* Builds the Tiled `slice` query-string parameter, fetching array structure
|
|
181
|
+
* from the server when it is not already in `options`.
|
|
182
|
+
*
|
|
183
|
+
* Used by `getArrayAsJSON`, `getArrayAsPng`, and `getArrayAsBuffer` inside
|
|
184
|
+
* `TiledApiClient` where async calls are fine.
|
|
185
|
+
*
|
|
186
|
+
* @param arrayPath - Tiled path to the array (used for the structure fetch).
|
|
187
|
+
* @param options - Array request options.
|
|
188
|
+
* @param fetchStructure - Optional callback to retrieve `ArrayStructure`.
|
|
189
|
+
* @returns A promise resolving to a slice string such as `"::2,::2"`.
|
|
190
|
+
*/
|
|
191
|
+
export declare function buildTiledArraySliceAsync(arrayPath: string, options?: TiledArrayRequestOptions, fetchStructure?: StructureFetcher): Promise<string>;
|
|
192
|
+
//# sourceMappingURL=TiledArrayApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TiledArrayApi.d.ts","sourceRoot":"","sources":["../../../../src/components/Tiled/api/TiledArrayApi.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,YAAY,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IACjB,GAAG,EAAE,IAAI,CAAC;IACV,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACnE;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEz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AE,wBAA6B,EACtC,cAAc,CAAC,EAAE,gBAAgB,GAChC,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TiledClientTest.d.ts","sourceRoot":"","sources":["../../../../src/components/Tiled/api/TiledClientTest.tsx"],"names":[],"mappings":"AAgxBA,MAAM,CAAC,OAAO,UAAU,eAAe,4CAsHtC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
export type TiledPathMode = 'relative' | 'absolute';
|
|
3
|
+
export interface TiledClientConfigApi {
|
|
4
|
+
setBaseUrl(baseUrl: string): void;
|
|
5
|
+
getBaseUrl(): string;
|
|
6
|
+
setInitialPath(initialPath: string): void;
|
|
7
|
+
getInitialPath(): string;
|
|
8
|
+
setApiKey(apiKey: string | null): void;
|
|
9
|
+
getApiKey(): string | null;
|
|
10
|
+
getAxiosClient(): AxiosInstance;
|
|
11
|
+
}
|
|
12
|
+
export interface TiledClientLike extends TiledClientConfigApi, AxiosInstance {
|
|
13
|
+
}
|
|
14
|
+
export interface TiledRequestOptions {
|
|
15
|
+
/**
|
|
16
|
+
* A fully defined Tiled client that replaces the default client.
|
|
17
|
+
*/
|
|
18
|
+
client?: TiledClientLike;
|
|
19
|
+
/**
|
|
20
|
+
* The base path to the Tiled server.
|
|
21
|
+
*
|
|
22
|
+
* Overrides whatever is configured in the default Tiled client or the
|
|
23
|
+
* client passed through `client`.
|
|
24
|
+
*/
|
|
25
|
+
baseUrl?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The initial path to prepend to the search path.
|
|
28
|
+
*
|
|
29
|
+
* Overrides the default initial path from any client.
|
|
30
|
+
*/
|
|
31
|
+
initialPath?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Controls how paths are resolved.
|
|
34
|
+
*
|
|
35
|
+
* - `relative`: prepends `initialPath`
|
|
36
|
+
* - `absolute`: disregards any `initialPath`
|
|
37
|
+
*
|
|
38
|
+
* Defaults to `relative`.
|
|
39
|
+
*/
|
|
40
|
+
pathMode?: TiledPathMode;
|
|
41
|
+
/**
|
|
42
|
+
* API key added to the request header.
|
|
43
|
+
*
|
|
44
|
+
* Overrides any default API key configured in any client.
|
|
45
|
+
*/
|
|
46
|
+
apiKey?: string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Signal from an AbortController.
|
|
49
|
+
*
|
|
50
|
+
* Can be used to cancel an in-flight request.
|
|
51
|
+
*/
|
|
52
|
+
signal?: AbortSignal;
|
|
53
|
+
}
|
|
54
|
+
export type TiledClientConfig = {
|
|
55
|
+
client?: AxiosInstance;
|
|
56
|
+
baseUrl?: string;
|
|
57
|
+
initialPath?: string;
|
|
58
|
+
apiKey?: string | null;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=TiledConfigApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TiledConfigApi.d.ts","sourceRoot":"","sources":["../../../../src/components/Tiled/api/TiledConfigApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,UAAU,IAAI,MAAM,CAAC;IAErB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,cAAc,IAAI,MAAM,CAAC;IAEzB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACvC,SAAS,IAAI,MAAM,GAAG,IAAI,CAAC;IAE3B,cAAc,IAAI,aAAa,CAAC;CACjC;AAED,MAAM,WAAW,eAAgB,SAAQ,oBAAoB,EAAE,aAAa;CAAG;AAE/E,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IAEzB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TiledTableApi } from './TiledTableApi';
|
|
2
|
+
import { TiledArrayApi } from './TiledArrayApi';
|
|
3
|
+
import { TiledSearchApi } from './TiledSearchApi';
|
|
4
|
+
import { TiledClientConfigApi } from './TiledConfigApi';
|
|
5
|
+
import { TiledMetadataApi } from './TiledMetadataApi';
|
|
6
|
+
import { TiledInfoApi } from './TiledInfoApi';
|
|
7
|
+
export type FinchTiledApi = TiledArrayApi & TiledTableApi & TiledSearchApi & TiledClientConfigApi & TiledMetadataApi & TiledInfoApi;
|
|
8
|
+
//# sourceMappingURL=TiledFinchApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TiledFinchApi.d.ts","sourceRoot":"","sources":["../../../../src/components/Tiled/api/TiledFinchApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,GAAG,oBAAoB,GAAG,gBAAgB,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TiledInfoApi.d.ts","sourceRoot":"","sources":["../../../../src/components/Tiled/api/TiledInfoApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,aAAa,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACjF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TiledRequestOptions } from './TiledConfigApi';
|
|
2
|
+
import { TiledSearchItem, TiledStructures } from '../types';
|
|
3
|
+
export interface TiledMetadataApi {
|
|
4
|
+
getMetadata<S extends TiledStructures = TiledStructures>(path: string, options?: TiledRequestOptions): Promise<TiledSearchItem<S>>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=TiledMetadataApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TiledMetadataApi.d.ts","sourceRoot":"","sources":["../../../../src/components/Tiled/api/TiledMetadataApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EACrD,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;CAChC"}
|