@wix/atlas 1.0.19 → 1.0.21
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/build/es/package.json +3 -0
- package/meta/package.json +1 -5
- package/package.json +21 -18
- package/build/cjs/context.d.ts +0 -3
- package/build/cjs/context.js +0 -30
- package/build/cjs/context.js.map +0 -1
- package/build/es/context.d.ts +0 -3
- package/build/es/context.js +0 -4
- package/build/es/context.js.map +0 -1
- package/context/package.json +0 -7
- package/type-bundles/context.bundle.d.ts +0 -895
- package/type-bundles/index.bundle.d.ts +0 -895
- package/type-bundles/meta.bundle.d.ts +0 -535
|
@@ -1,895 +0,0 @@
|
|
|
1
|
-
type HostModule<T, H extends Host> = {
|
|
2
|
-
__type: 'host';
|
|
3
|
-
create(host: H): T;
|
|
4
|
-
};
|
|
5
|
-
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6
|
-
type Host<Environment = unknown> = {
|
|
7
|
-
channel: {
|
|
8
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
9
|
-
disconnect: () => void;
|
|
10
|
-
} | Promise<{
|
|
11
|
-
disconnect: () => void;
|
|
12
|
-
}>;
|
|
13
|
-
};
|
|
14
|
-
environment?: Environment;
|
|
15
|
-
/**
|
|
16
|
-
* Optional name of the environment, use for logging
|
|
17
|
-
*/
|
|
18
|
-
name?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
21
|
-
*/
|
|
22
|
-
apiBaseUrl?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Possible data to be provided by every host, for cross cutting concerns
|
|
25
|
-
* like internationalization, billing, etc.
|
|
26
|
-
*/
|
|
27
|
-
essentials?: {
|
|
28
|
-
/**
|
|
29
|
-
* The language of the currently viewed session
|
|
30
|
-
*/
|
|
31
|
-
language?: string;
|
|
32
|
-
/**
|
|
33
|
-
* The locale of the currently viewed session
|
|
34
|
-
*/
|
|
35
|
-
locale?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Any headers that should be passed through to the API requests
|
|
38
|
-
*/
|
|
39
|
-
passThroughHeaders?: Record<string, string>;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
44
|
-
interface HttpClient {
|
|
45
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
46
|
-
fetchWithAuth: typeof fetch;
|
|
47
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
48
|
-
getActiveToken?: () => string | undefined;
|
|
49
|
-
}
|
|
50
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
51
|
-
type HttpResponse<T = any> = {
|
|
52
|
-
data: T;
|
|
53
|
-
status: number;
|
|
54
|
-
statusText: string;
|
|
55
|
-
headers: any;
|
|
56
|
-
request?: any;
|
|
57
|
-
};
|
|
58
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
59
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
60
|
-
url: string;
|
|
61
|
-
data?: Data;
|
|
62
|
-
params?: URLSearchParams;
|
|
63
|
-
} & APIMetadata;
|
|
64
|
-
type APIMetadata = {
|
|
65
|
-
methodFqn?: string;
|
|
66
|
-
entityFqdn?: string;
|
|
67
|
-
packageName?: string;
|
|
68
|
-
};
|
|
69
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
70
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
71
|
-
__type: 'event-definition';
|
|
72
|
-
type: Type;
|
|
73
|
-
isDomainEvent?: boolean;
|
|
74
|
-
transformations?: (envelope: unknown) => Payload;
|
|
75
|
-
__payload: Payload;
|
|
76
|
-
};
|
|
77
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
78
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
79
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
80
|
-
|
|
81
|
-
type ServicePluginMethodInput = {
|
|
82
|
-
request: any;
|
|
83
|
-
metadata: any;
|
|
84
|
-
};
|
|
85
|
-
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
86
|
-
type ServicePluginMethodMetadata = {
|
|
87
|
-
name: string;
|
|
88
|
-
primaryHttpMappingPath: string;
|
|
89
|
-
transformations: {
|
|
90
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
91
|
-
toREST: (...args: unknown[]) => unknown;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
95
|
-
__type: 'service-plugin-definition';
|
|
96
|
-
componentType: string;
|
|
97
|
-
methods: ServicePluginMethodMetadata[];
|
|
98
|
-
__contract: Contract;
|
|
99
|
-
};
|
|
100
|
-
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
101
|
-
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
102
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
103
|
-
|
|
104
|
-
type RequestContext = {
|
|
105
|
-
isSSR: boolean;
|
|
106
|
-
host: string;
|
|
107
|
-
protocol?: string;
|
|
108
|
-
};
|
|
109
|
-
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
110
|
-
/**
|
|
111
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
112
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
113
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
114
|
-
*/
|
|
115
|
-
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
116
|
-
type AmbassadorRequestOptions<T = any> = {
|
|
117
|
-
_?: T;
|
|
118
|
-
url?: string;
|
|
119
|
-
method?: Method;
|
|
120
|
-
params?: any;
|
|
121
|
-
data?: any;
|
|
122
|
-
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
123
|
-
};
|
|
124
|
-
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
125
|
-
__isAmbassador: boolean;
|
|
126
|
-
};
|
|
127
|
-
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
128
|
-
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
129
|
-
|
|
130
|
-
declare global {
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
132
|
-
interface SymbolConstructor {
|
|
133
|
-
readonly observable: symbol;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
declare const emptyObjectSymbol: unique symbol;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
141
|
-
|
|
142
|
-
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
143
|
-
|
|
144
|
-
@example
|
|
145
|
-
```
|
|
146
|
-
import type {EmptyObject} from 'type-fest';
|
|
147
|
-
|
|
148
|
-
// The following illustrates the problem with `{}`.
|
|
149
|
-
const foo1: {} = {}; // Pass
|
|
150
|
-
const foo2: {} = []; // Pass
|
|
151
|
-
const foo3: {} = 42; // Pass
|
|
152
|
-
const foo4: {} = {a: 1}; // Pass
|
|
153
|
-
|
|
154
|
-
// With `EmptyObject` only the first case is valid.
|
|
155
|
-
const bar1: EmptyObject = {}; // Pass
|
|
156
|
-
const bar2: EmptyObject = 42; // Fail
|
|
157
|
-
const bar3: EmptyObject = []; // Fail
|
|
158
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
162
|
-
|
|
163
|
-
@category Object
|
|
164
|
-
*/
|
|
165
|
-
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
Returns a boolean for whether the two given types are equal.
|
|
169
|
-
|
|
170
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
171
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
172
|
-
|
|
173
|
-
Use-cases:
|
|
174
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
175
|
-
|
|
176
|
-
@example
|
|
177
|
-
```
|
|
178
|
-
import type {IsEqual} from 'type-fest';
|
|
179
|
-
|
|
180
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
181
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
182
|
-
type Includes<Value extends readonly any[], Item> =
|
|
183
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
184
|
-
? IsEqual<Value[0], Item> extends true
|
|
185
|
-
? true
|
|
186
|
-
: Includes<rest, Item>
|
|
187
|
-
: false;
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
@category Type Guard
|
|
191
|
-
@category Utilities
|
|
192
|
-
*/
|
|
193
|
-
type IsEqual<A, B> =
|
|
194
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
195
|
-
(<G>() => G extends B ? 1 : 2)
|
|
196
|
-
? true
|
|
197
|
-
: false;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
Filter out keys from an object.
|
|
201
|
-
|
|
202
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
203
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
204
|
-
Returns `Key` otherwise.
|
|
205
|
-
|
|
206
|
-
@example
|
|
207
|
-
```
|
|
208
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
209
|
-
//=> never
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
@example
|
|
213
|
-
```
|
|
214
|
-
type Filtered = Filter<'bar', string>;
|
|
215
|
-
//=> never
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
@example
|
|
219
|
-
```
|
|
220
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
221
|
-
//=> 'bar'
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
@see {Except}
|
|
225
|
-
*/
|
|
226
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
227
|
-
|
|
228
|
-
type ExceptOptions = {
|
|
229
|
-
/**
|
|
230
|
-
Disallow assigning non-specified properties.
|
|
231
|
-
|
|
232
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
233
|
-
|
|
234
|
-
@default false
|
|
235
|
-
*/
|
|
236
|
-
requireExactProps?: boolean;
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
Create a type from an object type without certain keys.
|
|
241
|
-
|
|
242
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
243
|
-
|
|
244
|
-
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
245
|
-
|
|
246
|
-
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
247
|
-
|
|
248
|
-
@example
|
|
249
|
-
```
|
|
250
|
-
import type {Except} from 'type-fest';
|
|
251
|
-
|
|
252
|
-
type Foo = {
|
|
253
|
-
a: number;
|
|
254
|
-
b: string;
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
258
|
-
//=> {b: string}
|
|
259
|
-
|
|
260
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
261
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
262
|
-
|
|
263
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
264
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
265
|
-
|
|
266
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
267
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
@category Object
|
|
271
|
-
*/
|
|
272
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
273
|
-
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
274
|
-
} & (Options['requireExactProps'] extends true
|
|
275
|
-
? Partial<Record<KeysType, never>>
|
|
276
|
-
: {});
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
Returns a boolean for whether the given type is `never`.
|
|
280
|
-
|
|
281
|
-
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
282
|
-
@link https://stackoverflow.com/a/53984913/10292952
|
|
283
|
-
@link https://www.zhenghao.io/posts/ts-never
|
|
284
|
-
|
|
285
|
-
Useful in type utilities, such as checking if something does not occur.
|
|
286
|
-
|
|
287
|
-
@example
|
|
288
|
-
```
|
|
289
|
-
import type {IsNever, And} from 'type-fest';
|
|
290
|
-
|
|
291
|
-
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
292
|
-
type AreStringsEqual<A extends string, B extends string> =
|
|
293
|
-
And<
|
|
294
|
-
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
295
|
-
IsNever<Exclude<B, A>> extends true ? true : false
|
|
296
|
-
>;
|
|
297
|
-
|
|
298
|
-
type EndIfEqual<I extends string, O extends string> =
|
|
299
|
-
AreStringsEqual<I, O> extends true
|
|
300
|
-
? never
|
|
301
|
-
: void;
|
|
302
|
-
|
|
303
|
-
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
304
|
-
if (input === output) {
|
|
305
|
-
process.exit(0);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
endIfEqual('abc', 'abc');
|
|
310
|
-
//=> never
|
|
311
|
-
|
|
312
|
-
endIfEqual('abc', '123');
|
|
313
|
-
//=> void
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
@category Type Guard
|
|
317
|
-
@category Utilities
|
|
318
|
-
*/
|
|
319
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
323
|
-
|
|
324
|
-
@see {@link IsNever}
|
|
325
|
-
|
|
326
|
-
@example
|
|
327
|
-
```
|
|
328
|
-
import type {IfNever} from 'type-fest';
|
|
329
|
-
|
|
330
|
-
type ShouldBeTrue = IfNever<never>;
|
|
331
|
-
//=> true
|
|
332
|
-
|
|
333
|
-
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
334
|
-
//=> 'bar'
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
@category Type Guard
|
|
338
|
-
@category Utilities
|
|
339
|
-
*/
|
|
340
|
-
type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
341
|
-
IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
342
|
-
);
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
346
|
-
|
|
347
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
348
|
-
|
|
349
|
-
@example
|
|
350
|
-
```
|
|
351
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
352
|
-
|
|
353
|
-
interface Example {
|
|
354
|
-
a: string;
|
|
355
|
-
b: string | number;
|
|
356
|
-
c?: string;
|
|
357
|
-
d: {};
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
361
|
-
//=> 'a'
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
365
|
-
|
|
366
|
-
@example
|
|
367
|
-
```
|
|
368
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
369
|
-
|
|
370
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
371
|
-
//=> 'a' | 'c'
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
@category Object
|
|
375
|
-
*/
|
|
376
|
-
type ConditionalKeys<Base, Condition> =
|
|
377
|
-
{
|
|
378
|
-
// Map through all the keys of the given base type.
|
|
379
|
-
[Key in keyof Base]-?:
|
|
380
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
381
|
-
Base[Key] extends Condition
|
|
382
|
-
// Retain this key
|
|
383
|
-
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
384
|
-
? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
|
|
385
|
-
// Discard this key since the condition fails.
|
|
386
|
-
: never;
|
|
387
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
388
|
-
}[keyof Base];
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
392
|
-
|
|
393
|
-
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
394
|
-
|
|
395
|
-
@example
|
|
396
|
-
```
|
|
397
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
398
|
-
|
|
399
|
-
class Awesome {
|
|
400
|
-
name: string;
|
|
401
|
-
successes: number;
|
|
402
|
-
failures: bigint;
|
|
403
|
-
|
|
404
|
-
run() {}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
408
|
-
//=> {run: () => void}
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
@example
|
|
412
|
-
```
|
|
413
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
414
|
-
|
|
415
|
-
interface Example {
|
|
416
|
-
a: string;
|
|
417
|
-
b: string | number;
|
|
418
|
-
c: () => void;
|
|
419
|
-
d: {};
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
423
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
@category Object
|
|
427
|
-
*/
|
|
428
|
-
type ConditionalExcept<Base, Condition> = Except<
|
|
429
|
-
Base,
|
|
430
|
-
ConditionalKeys<Base, Condition>
|
|
431
|
-
>;
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
435
|
-
* can either be a REST module or a host module.
|
|
436
|
-
* This type is recursive, so it can describe nested modules.
|
|
437
|
-
*/
|
|
438
|
-
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
439
|
-
[key: string]: Descriptors | PublicMetadata | any;
|
|
440
|
-
};
|
|
441
|
-
/**
|
|
442
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
443
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
444
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
445
|
-
* do not match the given host (as they will not work with the given host).
|
|
446
|
-
*/
|
|
447
|
-
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
448
|
-
done: T;
|
|
449
|
-
recurse: T extends {
|
|
450
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
451
|
-
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
452
|
-
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
453
|
-
-1,
|
|
454
|
-
0,
|
|
455
|
-
1,
|
|
456
|
-
2,
|
|
457
|
-
3,
|
|
458
|
-
4,
|
|
459
|
-
5
|
|
460
|
-
][Depth]> : never;
|
|
461
|
-
}, EmptyObject>;
|
|
462
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
463
|
-
type PublicMetadata = {
|
|
464
|
-
PACKAGE_NAME?: string;
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
declare global {
|
|
468
|
-
interface ContextualClient {
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* A type used to create concerete types from SDK descriptors in
|
|
473
|
-
* case a contextual client is available.
|
|
474
|
-
*/
|
|
475
|
-
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
476
|
-
host: Host;
|
|
477
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
478
|
-
|
|
479
|
-
interface Place {
|
|
480
|
-
/** The given place id */
|
|
481
|
-
placeId?: string;
|
|
482
|
-
/** The Address object */
|
|
483
|
-
address?: Address$1;
|
|
484
|
-
/** The Place type. For example: airport, library etc... */
|
|
485
|
-
types?: string[];
|
|
486
|
-
}
|
|
487
|
-
/** Physical address */
|
|
488
|
-
interface Address$1 extends AddressStreetOneOf$1 {
|
|
489
|
-
/** Street name and number. */
|
|
490
|
-
streetAddress?: StreetAddress$1;
|
|
491
|
-
/** Main address line, usually street and number as free text. */
|
|
492
|
-
addressLine1?: string | null;
|
|
493
|
-
/** Country code. */
|
|
494
|
-
country?: string | null;
|
|
495
|
-
/** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */
|
|
496
|
-
subdivision?: string | null;
|
|
497
|
-
/** City name. */
|
|
498
|
-
city?: string | null;
|
|
499
|
-
/** Zip/postal code. */
|
|
500
|
-
postalCode?: string | null;
|
|
501
|
-
/** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */
|
|
502
|
-
addressLine2?: string | null;
|
|
503
|
-
}
|
|
504
|
-
/** @oneof */
|
|
505
|
-
interface AddressStreetOneOf$1 {
|
|
506
|
-
/** Street name and number. */
|
|
507
|
-
streetAddress?: StreetAddress$1;
|
|
508
|
-
/** Main address line, usually street and number as free text. */
|
|
509
|
-
addressLine?: string | null;
|
|
510
|
-
}
|
|
511
|
-
interface StreetAddress$1 {
|
|
512
|
-
/** Street number. */
|
|
513
|
-
number?: string;
|
|
514
|
-
/** Street name. */
|
|
515
|
-
name?: string;
|
|
516
|
-
}
|
|
517
|
-
interface AddressLocation$2 {
|
|
518
|
-
/** Address latitude. */
|
|
519
|
-
latitude?: number | null;
|
|
520
|
-
/** Address longitude. */
|
|
521
|
-
longitude?: number | null;
|
|
522
|
-
}
|
|
523
|
-
interface Subdivision$1 {
|
|
524
|
-
/** Short subdivision code. */
|
|
525
|
-
code?: string;
|
|
526
|
-
/** Subdivision full name. */
|
|
527
|
-
name?: string;
|
|
528
|
-
}
|
|
529
|
-
declare enum SubdivisionType$1 {
|
|
530
|
-
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
531
|
-
/** State */
|
|
532
|
-
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
533
|
-
/** County */
|
|
534
|
-
ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
|
|
535
|
-
/** City/town */
|
|
536
|
-
ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
|
|
537
|
-
/** Neighborhood/quarter */
|
|
538
|
-
ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
|
|
539
|
-
/** Street/block */
|
|
540
|
-
ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
|
|
541
|
-
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
542
|
-
COUNTRY = "COUNTRY"
|
|
543
|
-
}
|
|
544
|
-
interface GetPlaceRequest {
|
|
545
|
-
searchId: string;
|
|
546
|
-
/** A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session. */
|
|
547
|
-
sessionToken?: string | null;
|
|
548
|
-
}
|
|
549
|
-
interface GetPlaceResponse {
|
|
550
|
-
place?: Place;
|
|
551
|
-
}
|
|
552
|
-
interface StreetAddressNonNullableFields$1 {
|
|
553
|
-
number: string;
|
|
554
|
-
name: string;
|
|
555
|
-
apt: string;
|
|
556
|
-
}
|
|
557
|
-
interface AddressNonNullableFields$1 {
|
|
558
|
-
streetAddress?: StreetAddressNonNullableFields$1;
|
|
559
|
-
}
|
|
560
|
-
interface PlaceNonNullableFields {
|
|
561
|
-
placeId: string;
|
|
562
|
-
address?: AddressNonNullableFields$1;
|
|
563
|
-
types: string[];
|
|
564
|
-
}
|
|
565
|
-
interface GetPlaceResponseNonNullableFields {
|
|
566
|
-
place?: PlaceNonNullableFields;
|
|
567
|
-
}
|
|
568
|
-
interface GetPlaceOptions {
|
|
569
|
-
/** A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session. */
|
|
570
|
-
sessionToken?: string | null;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
declare function getPlace$1(httpClient: HttpClient): GetPlaceSignature;
|
|
574
|
-
interface GetPlaceSignature {
|
|
575
|
-
/**
|
|
576
|
-
* Once you have a search_id from a autocomplete Search, you can request more details about a particular establishment or point of interest by initiating a get place request.
|
|
577
|
-
*/
|
|
578
|
-
(searchId: string, options?: GetPlaceOptions | undefined): Promise<GetPlaceResponse & GetPlaceResponseNonNullableFields>;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
declare const getPlace: MaybeContext<BuildRESTFunction<typeof getPlace$1> & typeof getPlace$1>;
|
|
582
|
-
|
|
583
|
-
type context$2_GetPlaceOptions = GetPlaceOptions;
|
|
584
|
-
type context$2_GetPlaceRequest = GetPlaceRequest;
|
|
585
|
-
type context$2_GetPlaceResponse = GetPlaceResponse;
|
|
586
|
-
type context$2_GetPlaceResponseNonNullableFields = GetPlaceResponseNonNullableFields;
|
|
587
|
-
type context$2_Place = Place;
|
|
588
|
-
declare const context$2_getPlace: typeof getPlace;
|
|
589
|
-
declare namespace context$2 {
|
|
590
|
-
export { type Address$1 as Address, type AddressLocation$2 as AddressLocation, type AddressStreetOneOf$1 as AddressStreetOneOf, type context$2_GetPlaceOptions as GetPlaceOptions, type context$2_GetPlaceRequest as GetPlaceRequest, type context$2_GetPlaceResponse as GetPlaceResponse, type context$2_GetPlaceResponseNonNullableFields as GetPlaceResponseNonNullableFields, type context$2_Place as Place, type StreetAddress$1 as StreetAddress, type Subdivision$1 as Subdivision, SubdivisionType$1 as SubdivisionType, context$2_getPlace as getPlace };
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
interface Prediction {
|
|
594
|
-
/** The human-readable name of the prediction */
|
|
595
|
-
description?: string;
|
|
596
|
-
/** The id of the prediction that can be use in place api. Available for short time. */
|
|
597
|
-
searchId?: string;
|
|
598
|
-
/** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */
|
|
599
|
-
matchedSubstrings?: MatchedSubstrings[];
|
|
600
|
-
/** Provides pre-formatted text that can be shown in your autocomplete results */
|
|
601
|
-
textStructure?: TextStructure;
|
|
602
|
-
/** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */
|
|
603
|
-
distanceInMeters?: number | null;
|
|
604
|
-
}
|
|
605
|
-
interface MatchedSubstrings {
|
|
606
|
-
length?: number;
|
|
607
|
-
offset?: number;
|
|
608
|
-
}
|
|
609
|
-
interface TextStructure {
|
|
610
|
-
/** Contains the main text of a prediction, usually the name of the place */
|
|
611
|
-
mainText?: string;
|
|
612
|
-
/** Contains the secondary text of a prediction, usually the location of the place */
|
|
613
|
-
secondaryText?: string;
|
|
614
|
-
/** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */
|
|
615
|
-
mainTextMatchedSubstrings?: MatchedSubstrings[];
|
|
616
|
-
}
|
|
617
|
-
interface ListPredictionsRequest {
|
|
618
|
-
/** The text the predictions will be based on. */
|
|
619
|
-
input?: string;
|
|
620
|
-
/** The origin point from which to calculate straight-line distance to the destination */
|
|
621
|
-
origin?: AddressLocation$1;
|
|
622
|
-
/** The point around which you wish to retrieve place information */
|
|
623
|
-
location?: AddressLocation$1;
|
|
624
|
-
/** The acceptable distance from that location (in meters) */
|
|
625
|
-
radius?: string | null;
|
|
626
|
-
/** Filters the user can add in order to get more accurate results */
|
|
627
|
-
filterBy?: FilterBy$1[];
|
|
628
|
-
}
|
|
629
|
-
interface AddressLocation$1 {
|
|
630
|
-
/** Address latitude. */
|
|
631
|
-
latitude?: number | null;
|
|
632
|
-
/** Address longitude. */
|
|
633
|
-
longitude?: number | null;
|
|
634
|
-
}
|
|
635
|
-
interface FilterBy$1 {
|
|
636
|
-
/** One of the filter types enum */
|
|
637
|
-
filterType?: FilterType$1;
|
|
638
|
-
/** Free text like "us" */
|
|
639
|
-
filterValue?: string;
|
|
640
|
-
}
|
|
641
|
-
declare enum FilterType$1 {
|
|
642
|
-
/** Filter by zip code */
|
|
643
|
-
zip_code = "zip_code",
|
|
644
|
-
/** Filter by 2-letters or 3-letters country code */
|
|
645
|
-
country_code = "country_code"
|
|
646
|
-
}
|
|
647
|
-
interface ListPredictionsResponse {
|
|
648
|
-
predictions?: Prediction[];
|
|
649
|
-
}
|
|
650
|
-
interface PredictRequest {
|
|
651
|
-
/** The text the predictions will be based on. */
|
|
652
|
-
input: string;
|
|
653
|
-
/** The origin point from which to calculate straight-line distance to the destination */
|
|
654
|
-
origin?: AddressLocation$1;
|
|
655
|
-
/** The point around which you wish to retrieve place information */
|
|
656
|
-
location?: AddressLocation$1;
|
|
657
|
-
/** The acceptable distance from that location (in meters) */
|
|
658
|
-
radius?: string | null;
|
|
659
|
-
/** alpha-2 or alpha-3 ISO-3166 country codes to filter by */
|
|
660
|
-
countryCodes?: string[];
|
|
661
|
-
/** A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session. */
|
|
662
|
-
sessionToken?: string | null;
|
|
663
|
-
}
|
|
664
|
-
interface PredictResponse {
|
|
665
|
-
predictions?: Prediction[];
|
|
666
|
-
}
|
|
667
|
-
interface MatchedSubstringsNonNullableFields {
|
|
668
|
-
length: number;
|
|
669
|
-
offset: number;
|
|
670
|
-
}
|
|
671
|
-
interface TextStructureNonNullableFields {
|
|
672
|
-
mainText: string;
|
|
673
|
-
secondaryText: string;
|
|
674
|
-
mainTextMatchedSubstrings: MatchedSubstringsNonNullableFields[];
|
|
675
|
-
}
|
|
676
|
-
interface PredictionNonNullableFields {
|
|
677
|
-
description: string;
|
|
678
|
-
searchId: string;
|
|
679
|
-
matchedSubstrings: MatchedSubstringsNonNullableFields[];
|
|
680
|
-
textStructure?: TextStructureNonNullableFields;
|
|
681
|
-
}
|
|
682
|
-
interface PredictResponseNonNullableFields {
|
|
683
|
-
predictions: PredictionNonNullableFields[];
|
|
684
|
-
}
|
|
685
|
-
interface PredictOptions {
|
|
686
|
-
/** The origin point from which to calculate straight-line distance to the destination */
|
|
687
|
-
origin?: AddressLocation$1;
|
|
688
|
-
/** The point around which you wish to retrieve place information */
|
|
689
|
-
location?: AddressLocation$1;
|
|
690
|
-
/** The acceptable distance from that location (in meters) */
|
|
691
|
-
radius?: string | null;
|
|
692
|
-
/** alpha-2 or alpha-3 ISO-3166 country codes to filter by */
|
|
693
|
-
countryCodes?: string[];
|
|
694
|
-
/** A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session. */
|
|
695
|
-
sessionToken?: string | null;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
declare function predict$1(httpClient: HttpClient): PredictSignature;
|
|
699
|
-
interface PredictSignature {
|
|
700
|
-
/**
|
|
701
|
-
* A Predict end-point take an input and returns an list of Prediction object.
|
|
702
|
-
* @param - The text the predictions will be based on.
|
|
703
|
-
*/
|
|
704
|
-
(input: string, options?: PredictOptions | undefined): Promise<PredictResponse & PredictResponseNonNullableFields>;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
declare const predict: MaybeContext<BuildRESTFunction<typeof predict$1> & typeof predict$1>;
|
|
708
|
-
|
|
709
|
-
type context$1_ListPredictionsRequest = ListPredictionsRequest;
|
|
710
|
-
type context$1_ListPredictionsResponse = ListPredictionsResponse;
|
|
711
|
-
type context$1_MatchedSubstrings = MatchedSubstrings;
|
|
712
|
-
type context$1_PredictOptions = PredictOptions;
|
|
713
|
-
type context$1_PredictRequest = PredictRequest;
|
|
714
|
-
type context$1_PredictResponse = PredictResponse;
|
|
715
|
-
type context$1_PredictResponseNonNullableFields = PredictResponseNonNullableFields;
|
|
716
|
-
type context$1_Prediction = Prediction;
|
|
717
|
-
type context$1_TextStructure = TextStructure;
|
|
718
|
-
declare const context$1_predict: typeof predict;
|
|
719
|
-
declare namespace context$1 {
|
|
720
|
-
export { type AddressLocation$1 as AddressLocation, type FilterBy$1 as FilterBy, FilterType$1 as FilterType, type context$1_ListPredictionsRequest as ListPredictionsRequest, type context$1_ListPredictionsResponse as ListPredictionsResponse, type context$1_MatchedSubstrings as MatchedSubstrings, type context$1_PredictOptions as PredictOptions, type context$1_PredictRequest as PredictRequest, type context$1_PredictResponse as PredictResponse, type context$1_PredictResponseNonNullableFields as PredictResponseNonNullableFields, type context$1_Prediction as Prediction, type context$1_TextStructure as TextStructure, context$1_predict as predict };
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
interface SearchResult {
|
|
724
|
-
/** The Address object */
|
|
725
|
-
address?: Address;
|
|
726
|
-
/** stores additional data about the proximity to the specified location */
|
|
727
|
-
proximity?: Proximity;
|
|
728
|
-
}
|
|
729
|
-
/** Physical address */
|
|
730
|
-
interface Address extends AddressStreetOneOf {
|
|
731
|
-
/** Street name and number. */
|
|
732
|
-
streetAddress?: StreetAddress;
|
|
733
|
-
/** Main address line, usually street and number as free text. */
|
|
734
|
-
addressLine1?: string | null;
|
|
735
|
-
/** Country code. */
|
|
736
|
-
country?: string | null;
|
|
737
|
-
/** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */
|
|
738
|
-
subdivision?: string | null;
|
|
739
|
-
/** City name. */
|
|
740
|
-
city?: string | null;
|
|
741
|
-
/** Zip/postal code. */
|
|
742
|
-
postalCode?: string | null;
|
|
743
|
-
/** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */
|
|
744
|
-
addressLine2?: string | null;
|
|
745
|
-
}
|
|
746
|
-
/** @oneof */
|
|
747
|
-
interface AddressStreetOneOf {
|
|
748
|
-
/** Street name and number. */
|
|
749
|
-
streetAddress?: StreetAddress;
|
|
750
|
-
/** Main address line, usually street and number as free text. */
|
|
751
|
-
addressLine?: string | null;
|
|
752
|
-
}
|
|
753
|
-
interface StreetAddress {
|
|
754
|
-
/** Street number. */
|
|
755
|
-
number?: string;
|
|
756
|
-
/** Street name. */
|
|
757
|
-
name?: string;
|
|
758
|
-
}
|
|
759
|
-
interface AddressLocation {
|
|
760
|
-
/** Address latitude. */
|
|
761
|
-
latitude?: number | null;
|
|
762
|
-
/** Address longitude. */
|
|
763
|
-
longitude?: number | null;
|
|
764
|
-
}
|
|
765
|
-
interface Subdivision {
|
|
766
|
-
/** Short subdivision code. */
|
|
767
|
-
code?: string;
|
|
768
|
-
/** Subdivision full name. */
|
|
769
|
-
name?: string;
|
|
770
|
-
}
|
|
771
|
-
declare enum SubdivisionType {
|
|
772
|
-
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
773
|
-
/** State */
|
|
774
|
-
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
775
|
-
/** County */
|
|
776
|
-
ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
|
|
777
|
-
/** City/town */
|
|
778
|
-
ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
|
|
779
|
-
/** Neighborhood/quarter */
|
|
780
|
-
ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
|
|
781
|
-
/** Street/block */
|
|
782
|
-
ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
|
|
783
|
-
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
784
|
-
COUNTRY = "COUNTRY"
|
|
785
|
-
}
|
|
786
|
-
declare enum Proximity {
|
|
787
|
-
UNKNOWN_PROXIMITY = "UNKNOWN_PROXIMITY",
|
|
788
|
-
/** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
|
|
789
|
-
PINPOINT = "PINPOINT",
|
|
790
|
-
/** indicates that the returned result is the geometric center of a result */
|
|
791
|
-
APPROXIMATE = "APPROXIMATE",
|
|
792
|
-
/** indicates that the returned result is around an area */
|
|
793
|
-
GENERAL_AREA = "GENERAL_AREA"
|
|
794
|
-
}
|
|
795
|
-
/** User must provide query or filter by parameters */
|
|
796
|
-
interface SearchRequest {
|
|
797
|
-
/** Free text */
|
|
798
|
-
query?: string | null;
|
|
799
|
-
/**
|
|
800
|
-
* Deprecate! - Please use 'zipCode' and 'countryCodes' fields
|
|
801
|
-
* @deprecated
|
|
802
|
-
*/
|
|
803
|
-
filterBy?: FilterBy[];
|
|
804
|
-
/** Zip code filter the user can add in order to get more accurate results */
|
|
805
|
-
zipCode?: string | null;
|
|
806
|
-
/** Country codes filter the user can add in order to get more accurate results */
|
|
807
|
-
countryCodes?: string[];
|
|
808
|
-
}
|
|
809
|
-
interface FilterBy {
|
|
810
|
-
/** One of the filter types enum */
|
|
811
|
-
filterType?: FilterType;
|
|
812
|
-
/** Free text like "us" */
|
|
813
|
-
filterValue?: string;
|
|
814
|
-
}
|
|
815
|
-
declare enum FilterType {
|
|
816
|
-
/** Filter by zip code */
|
|
817
|
-
zip_code = "zip_code",
|
|
818
|
-
/** Filter by 2-letters or 3-letters country code */
|
|
819
|
-
country_code = "country_code"
|
|
820
|
-
}
|
|
821
|
-
interface SearchResponse {
|
|
822
|
-
/** List of 'Address' objects */
|
|
823
|
-
searchResults?: SearchResult[];
|
|
824
|
-
}
|
|
825
|
-
interface ReverseGeocodingRequest {
|
|
826
|
-
/** The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address. */
|
|
827
|
-
addressLocation?: AddressLocation;
|
|
828
|
-
}
|
|
829
|
-
interface ReverseGeocodingResponse {
|
|
830
|
-
searchResults?: SearchResult[];
|
|
831
|
-
}
|
|
832
|
-
interface StreetAddressNonNullableFields {
|
|
833
|
-
number: string;
|
|
834
|
-
name: string;
|
|
835
|
-
apt: string;
|
|
836
|
-
}
|
|
837
|
-
interface AddressNonNullableFields {
|
|
838
|
-
streetAddress?: StreetAddressNonNullableFields;
|
|
839
|
-
}
|
|
840
|
-
interface SearchResultNonNullableFields {
|
|
841
|
-
address?: AddressNonNullableFields;
|
|
842
|
-
proximity: Proximity;
|
|
843
|
-
}
|
|
844
|
-
interface SearchResponseNonNullableFields {
|
|
845
|
-
searchResults: SearchResultNonNullableFields[];
|
|
846
|
-
}
|
|
847
|
-
interface SearchOptions {
|
|
848
|
-
/** Free text */
|
|
849
|
-
query?: string | null;
|
|
850
|
-
/**
|
|
851
|
-
* Deprecate! - Please use 'zipCode' and 'countryCodes' fields
|
|
852
|
-
* @deprecated
|
|
853
|
-
*/
|
|
854
|
-
filterBy?: FilterBy[];
|
|
855
|
-
/** Zip code filter the user can add in order to get more accurate results */
|
|
856
|
-
zipCode?: string | null;
|
|
857
|
-
/** Country codes filter the user can add in order to get more accurate results */
|
|
858
|
-
countryCodes?: string[];
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
declare function search$1(httpClient: HttpClient): SearchSignature;
|
|
862
|
-
interface SearchSignature {
|
|
863
|
-
/**
|
|
864
|
-
* A Search request takes a free text as an input and returns a list of 'Address' objects.
|
|
865
|
-
*/
|
|
866
|
-
(options?: SearchOptions | undefined): Promise<SearchResponse & SearchResponseNonNullableFields>;
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
declare const search: MaybeContext<BuildRESTFunction<typeof search$1> & typeof search$1>;
|
|
870
|
-
|
|
871
|
-
type context_Address = Address;
|
|
872
|
-
type context_AddressLocation = AddressLocation;
|
|
873
|
-
type context_AddressStreetOneOf = AddressStreetOneOf;
|
|
874
|
-
type context_FilterBy = FilterBy;
|
|
875
|
-
type context_FilterType = FilterType;
|
|
876
|
-
declare const context_FilterType: typeof FilterType;
|
|
877
|
-
type context_Proximity = Proximity;
|
|
878
|
-
declare const context_Proximity: typeof Proximity;
|
|
879
|
-
type context_ReverseGeocodingRequest = ReverseGeocodingRequest;
|
|
880
|
-
type context_ReverseGeocodingResponse = ReverseGeocodingResponse;
|
|
881
|
-
type context_SearchOptions = SearchOptions;
|
|
882
|
-
type context_SearchRequest = SearchRequest;
|
|
883
|
-
type context_SearchResponse = SearchResponse;
|
|
884
|
-
type context_SearchResponseNonNullableFields = SearchResponseNonNullableFields;
|
|
885
|
-
type context_SearchResult = SearchResult;
|
|
886
|
-
type context_StreetAddress = StreetAddress;
|
|
887
|
-
type context_Subdivision = Subdivision;
|
|
888
|
-
type context_SubdivisionType = SubdivisionType;
|
|
889
|
-
declare const context_SubdivisionType: typeof SubdivisionType;
|
|
890
|
-
declare const context_search: typeof search;
|
|
891
|
-
declare namespace context {
|
|
892
|
-
export { type context_Address as Address, type context_AddressLocation as AddressLocation, type context_AddressStreetOneOf as AddressStreetOneOf, type context_FilterBy as FilterBy, context_FilterType as FilterType, context_Proximity as Proximity, type context_ReverseGeocodingRequest as ReverseGeocodingRequest, type context_ReverseGeocodingResponse as ReverseGeocodingResponse, type context_SearchOptions as SearchOptions, type context_SearchRequest as SearchRequest, type context_SearchResponse as SearchResponse, type context_SearchResponseNonNullableFields as SearchResponseNonNullableFields, type context_SearchResult as SearchResult, type context_StreetAddress as StreetAddress, type context_Subdivision as Subdivision, context_SubdivisionType as SubdivisionType, context_search as search };
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
export { context$1 as autocomplete, context as location, context$2 as places };
|