-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.d.ts
239 lines (220 loc) · 7.77 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
declare module 'ApplicationBase/interfaces' {
import Portal = require('esri/portal/Portal');
import PortalItem = require('esri/portal/PortalItem');
import PortalQueryResult = require('esri/portal/PortalQueryResult');
import PortalQueryParams = require('esri/portal/PortalQueryParams');
import WebMap = require('esri/WebMap');
import WebScene = require('esri/WebScene');
export type Direction = "ltr" | "rtl";
export interface ApplicationBaseItemPromises {
webMap?: Promise<any>;
webScene?: Promise<any>;
groupInfo?: Promise<any>;
groupItems?: Promise<any>;
}
export interface ApplicationConfigs {
application?: ApplicationConfig;
config: ApplicationConfig;
local?: ApplicationConfig;
url?: ApplicationConfig;
}
export interface ApplicationConfig {
appid?: string;
center?: string;
components?: string;
embed?: boolean;
extent?: string;
find?: string;
group?: string | string[];
helperServices?: any;
level?: string;
marker?: string;
oauthappid?: string;
portalUrl?: string;
proxyUrl?: string;
title?: string;
viewpoint?: string;
webmap?: string | string[];
webscene?: string | string[];
[propName: string]: any;
}
export interface ApplicationBaseSettings {
localStorage?: {
fetch?: boolean;
};
group?: {
default?: string;
itemParams?: PortalQueryParams;
fetchItems?: boolean;
fetchInfo?: boolean;
fetchMultiple?: boolean;
};
portal?: {
fetch?: boolean;
};
urlParams?: string[];
webMap?: {
default?: string;
fetch?: boolean;
fetchMultiple?: boolean;
};
webScene?: {
default?: string;
fetch?: boolean;
fetchMultiple?: boolean;
}
}
export interface ApplicationBaseResult {
error?: Error;
value: any;
promise: Promise<any>;
}
export interface ApplicationBasePortalItemResult extends ApplicationBaseResult {
value: PortalItem;
promise: Promise<PortalItem>;
}
export interface ApplicationBasePortalQueryResult extends ApplicationBaseResult {
value: PortalQueryResult;
promise: Promise<PortalQueryResult>;
}
export interface ApplicationBaseResults {
applicationItem?: ApplicationBasePortalItemResult;
applicationData?: ApplicationBaseResult;
groupInfos?: ApplicationBasePortalQueryResult;
groupItems?: ApplicationBasePortalQueryResult;
localStorage?: ApplicationConfig;
portal?: Portal;
urlParams?: ApplicationConfig;
webMapItems?: ApplicationBasePortalItemResult[];
webSceneItems?: ApplicationBasePortalItemResult[];
}
export interface ApplicationProxy {
sourceUrl: string;
proxyUrl: string;
proxyId: string;
}
export interface ApplicationBaseConstructorOptions {
config: ApplicationConfig | string;
settings: ApplicationBaseSettings | string;
}
export interface CreateMapFromItemOptions {
item: PortalItem;
mapParams?: __esri.MapProperties,
appProxies?: ApplicationProxy[];
}
export interface esriWidgetProps extends __esri.WidgetProperties {
config: any;
view?: __esri.MapView;
portal?: __esri.Portal;
propertyName?: string;
}
}
declare module 'ApplicationBase/support/configParser' {
/// <reference types="arcgis-js-api" />
import { ApplicationConfig } from 'ApplicationBase/interfaces';
/**
* "Convert" functions handle backwards compatibility for the App Configs by transforming
* the inputted Config into a form that is equivalent to what the Config
* Panel would produce right at this moment.
*
* "Validate" functions handle turning potentially invalid app item JSON into a valid
* form, which will not cause the template app to error.
*
* *** NOTE:
* For all "Convert" additions below, please add a comment with the old
* interface that is being transformed from, and the new interface that
* is being transformed to
* ****
* @param config - App Config
*/
export function parseConfig(config: ApplicationConfig): ApplicationConfig;
export interface IExtentSelectorOutput {
constraints: __esri.MapViewConstraints;
mapRotation: number;
}
/**
* // old (extentSelectorConfig === __esri.MapViewConstraints)
* // =>
* // new (extentSelectorConfig === IExtentSelectorOutput)
* @param config
*/
export function _extentSelectorConfigConvert(extentSelectorConfig: any): IExtentSelectorOutput;
export function _extentSelectorConfigValidate(extentSelectorConfig: IExtentSelectorOutput): IExtentSelectorOutput;
}
declare module 'ApplicationBase/ApplicationBase' {
/// <reference types="arcgis-js-api" />
import { ApplicationBaseConstructorOptions, ApplicationBaseResults, ApplicationBaseSettings, ApplicationConfig, Direction } from 'ApplicationBase/interfaces';
import Portal from 'esri/portal/Portal';
import PortalQueryParams from 'esri/portal/PortalQueryParams'; class ApplicationBase {
constructor(options: ApplicationBaseConstructorOptions);
settings: ApplicationBaseSettings;
config: ApplicationConfig;
results: ApplicationBaseResults;
portal: Portal;
direction: Direction;
locale: string;
isIE: boolean;
units: string;
invalidContentOrigin: boolean;
queryGroupItems(groupId: string, itemParams: PortalQueryParams, portal?: Portal): Promise<__esri.PortalQueryResult>;
load(): Promise<ApplicationBase>;
private _mixinSettingsDefaults;
private _limitItemSize;
private _getPropertyArray;
private _getEsriEnvironmentPortalUrl;
private _getEsriEnvironmentProxyUrl;
private _isEnvironmentEsri;
private _isPortalServer;
private _getUnits;
private _detectIE;
private _queryGroupInfo;
private _loadItem;
private _overwriteItemsExtent;
private _overwriteItemExtent;
private _getDefaultId;
private _mixinAllConfigs;
private _setGeometryService;
private _setPortalUrl;
private _setProxyUrl;
private _registerOauthInfos;
private _getUrlParamValues;
private _urlToObject;
private _formatUrlParamValue;
private _stripStringTags;
private _getAppUrl;
private _isWithinConfigurationExperience;
}
export = ApplicationBase;
}
declare module 'ApplicationBase/support/domHelper' {
export function setPageLocale(locale: string): void;
export function setPageDirection(direction: string): void;
export function setPageTitle(title: string): void;
}
declare module 'ApplicationBase/support/urlUtils' {
/// <reference types="arcgis-js-api" />
import Camera from 'esri/Camera';
import Extent from 'esri/geometry/Extent';
import Point from 'esri/geometry/Point';
import esri = __esri;
export function parseViewComponents(components: string): string[];
export function parseViewpoint(viewpoint: string): Camera;
export function parseCenter(center: string): Point;
export function parseLevel(level: string): number;
export function parseExtent(extent: string): Extent;
export function parseMarker(marker: string): Promise<esri.Graphic | {}>;
}
declare module 'ApplicationBase/support/itemUtils' {
/// <reference types="arcgis-js-api" />
import PortalItem from 'esri/portal/PortalItem';
import { CreateMapFromItemOptions, ApplicationConfig } from 'ApplicationBase/interfaces';
import esri = __esri;
export function getConfigViewProperties(config: ApplicationConfig): any;
export function createView(properties: any): Promise<esri.MapView | esri.SceneView>;
export function createMapFromItem(options: CreateMapFromItemOptions): Promise<esri.WebMap | esri.WebScene>;
export function createWebMapFromItem(options: CreateMapFromItemOptions): Promise<esri.WebMap>;
export function createWebSceneFromItem(options: CreateMapFromItemOptions): Promise<esri.WebScene>;
export function getItemTitle(item: PortalItem): string;
export function goToMarker(marker: string, view: esri.MapView | esri.SceneView): Promise<any>;
export function findQuery(query: string, view: esri.MapView | esri.SceneView): Promise<any>;
}