Skip to content

Commit

Permalink
Merge pull request #195 from JeffJacobson/add-types
Browse files Browse the repository at this point in the history
arcgis-rest-common-types -- Added WebMap interfaces
  • Loading branch information
jgravois authored May 16, 2018
2 parents 80faae8 + e5572b2 commit fa3adce
Show file tree
Hide file tree
Showing 4 changed files with 1,268 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/arcgis-rest-common-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
"author": "",
"license": "Apache-2.0",
"files": [
"dist/types/index.d.ts"
"dist/types/*.d.ts"
],
"scripts": {
"prepare": "npm run build",
"build": "npm run build:esm",
"build:esm": "tsc --module es2015 --outDir ./dist/esm --sourceMap --declaration --declarationDir ./dist/types",
"postbuild": "rimraf dist/esm"
"build:esm": "tsc"
},
"publishConfig": {
"access": "public"
Expand Down
37 changes: 35 additions & 2 deletions packages/arcgis-rest-common-types/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* Copyright (c) 2017 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

export * from "./webmap";

/**
* an arc can be represented as a JSON curve object
*/
Expand Down Expand Up @@ -46,16 +48,47 @@ export type ElipticArc = IArc;
export interface IFeature {
geometry?: IGeometry;
attributes: { [key: string]: any };
symbol?: ISymbol;
}

/**
*
* Field type.
*/
export type esriFieldType =
| "esriFieldTypeBlob"
| "esriFieldTypeDate"
| "esriFieldTypeDouble"
| "esriFieldTypeGeometry"
| "esriFieldTypeGlobalID"
| "esriFieldTypeGUID"
| "esriFieldTypeInteger"
| "esriFieldTypeOID"
| "esriFieldTypeRaster"
| "esriFieldTypeSingle"
| "esriFieldTypeSmallInteger"
| "esriFieldTypeString"
| "esriFieldTypeXML";

/**
* Contains information about an attribute field.
*/
export interface IField {
/** A string defining the field name. */
name: string;
type: string;
/** A string defining the field type. */
type: esriFieldType;
/** A string defining the field alias. */
alias?: string;
/** The domain objects if applicable. */
domain?: any;
/** A Boolean defining whether this field is editable. */
editable?: boolean;
/** A Boolean defining whether or not the field is an exact match. */
exactMatch?: boolean;
/** A number defining how many characters are allowed in a string. field. */
length?: number;
/** A Boolean defining whether this field can have a null value. */
nullable?: boolean;
}

/**
Expand Down
Loading

0 comments on commit fa3adce

Please sign in to comment.