Skip to content

Commit

Permalink
Merge pull request #681 from Esri/ganesh/#668-revert-const-enum-update
Browse files Browse the repository at this point in the history
Revert Merge pull request #656 to remove const enums usage.
  • Loading branch information
tomwayson authored Apr 3, 2020
2 parents 34f5037 + 41e1e7c commit ea218f0
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 213 deletions.
28 changes: 2 additions & 26 deletions packages/arcgis-rest-types/src/statisticDefinition.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
/* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

/**
* Enum of all different statistics operations
*/
export const enum StatisticType {
Count = "count",
Sum = "sum",
Minimum = "min",
Maximum = "max",
Average = "avg",
StandardDeviation = "stddev",
Variance = "var",
ContinuousPercentile = "percentile_cont",
DiscretePercentile = "percentile_disc"
}

/**
* Enum of sorting orders
*/
export const enum SortingOrder {
Ascending = "asc",
Descending = "desc"
}

export interface IStatisticDefinition {
/**
* Statistical operation to perform (count, sum, min, max, avg, stddev, var, percentile_cont, percentile_disc).
Expand All @@ -37,14 +14,13 @@ export interface IStatisticDefinition {
| "stddev"
| "var"
| "percentile_cont"
| "percentile_disc"
| StatisticType;
| "percentile_disc";
/**
* Parameter to be used along with statisticType. Currently, only applicable for percentile_cont (continuous percentile) and percentile_disc (discrete percentile).
*/
statisticParameter?: {
value: number;
orderBy?: "asc" | "desc" | SortingOrder;
orderBy?: "asc" | "desc";
};
/**
* Field on which to perform the statistical operation.
Expand Down
185 changes: 52 additions & 133 deletions packages/arcgis-rest-types/src/symbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,15 @@
*/
export type Color = [number, number, number, number];

/**
*
*/
export const enum FontStyle {
Italic = "italic",
Normal = "normal",
Oblique = "oblique"
}

/**
*
*/
export const enum FontWeight {
Bold = "bold",
Bolder = "bolder",
Lighter = "lighter",
Normal = "normal"
}

/**
*
*/
export const enum FontDecoration {
LineThrough = "line-through",
Underline = "underline",
None = "none"
}

/**
*
*/
export interface IFont {
family?: string; // "<fontFamily>";
size?: number; // <fontSize>;
style?: "italic" | "normal" | "oblique" | FontStyle;
weight?: "bold" | "bolder" | "lighter" | "normal" | FontWeight;
decoration?: "line-through" | "underline" | "none" | FontDecoration;
style?: "italic" | "normal" | "oblique";
weight?: "bold" | "bolder" | "lighter" | "normal";
decoration?: "line-through" | "underline" | "none";
}

/**
Expand All @@ -62,27 +34,16 @@ export interface IPictureSourced {
/**
*
*/
export const enum SymbolType {
SLS = "esriSLS",
SMS = "esriSMS",
SFS = "esriSFS",
PMS = "esriPMS",
PFS = "esriPFS",
TS = "esriTS"
export interface ISymbol {
type: SymbolType;
style?: string;
}

/**
*
*/
export interface ISymbol {
type:
| "esriSLS"
| "esriSMS"
| "esriSFS"
| "esriPMS"
| "esriPFS"
| "esriTS"
| SymbolType;
type: SymbolType;
style?: string;
}

Expand All @@ -99,7 +60,7 @@ export interface IMarkerSymbol extends ISymbol {
*
*/
export interface IPictureFillSymbol extends ISymbol, IPictureSourced {
type: "esriPFS" | SymbolType.PFS;
type: "esriPFS";
outline?: ISimpleLineSymbol; // if outline has been specified
xscale?: number;
yscale?: number;
Expand All @@ -109,62 +70,61 @@ export interface IPictureFillSymbol extends ISymbol, IPictureSourced {
*
*/
export interface IPictureMarkerSymbol extends IMarkerSymbol, IPictureSourced {
type: "esriPMS" | SymbolType.PMS;
type: "esriPMS";
}

/**
*
*/
export const enum SimpleMarkerSymbolStyle {
Circle = "esriSMSCircle",
Cross = "esriSMSCross",
Diamond = "esriSMSDiamond",
Square = "esriSMSSquare",
X = "esriSMSX",
Triangle = "esriSMSTriangle"
}
export type SimpleMarkerSymbolStyle =
| "esriSMSCircle"
| "esriSMSCross"
| "esriSMSDiamond"
| "esriSMSSquare"
| "esriSMSX"
| "esriSMSTriangle";

/**
*
*/
export const enum SimpleLineSymbolStyle {
Dash = "esriSLSDash",
DashDot = "esriSLSDashDot",
DashDotDot = "esriSLSDashDotDot",
Dot = "esriSLSDot",
Null = "esriSLSNull",
Solid = "esriSLSSolid"
}
export type SimpleLineSymbolStyle =
| "esriSLSDash"
| "esriSLSDashDot"
| "esriSLSDashDotDot"
| "esriSLSDot"
| "esriSLSNull"
| "esriSLSSolid";

/**
*
*/
export const enum SimpleFillSymbolStyle {
BackwardDiagonal = "esriSFSBackwardDiagonal",
Cross = "esriSFSCross",
DiagonalCross = "esriSFSDiagonalCross",
ForwardDiagonal = "esriSFSForwardDiagonal",
Horizontal = "esriSFSHorizontal",
Null = "esriSFSNull",
Solid = "esriSFSSolid",
Vertical = "esriSFSVertical"
}
export type SimpleFillSymbolStyle =
| "esriSFSBackwardDiagonal"
| "esriSFSCross"
| "esriSFSDiagonalCross"
| "esriSFSForwardDiagonal"
| "esriSFSHorizontal"
| "esriSFSNull"
| "esriSFSSolid"
| "esriSFSVertical";

/**
*
*/
export type SymbolType =
| "esriSLS"
| "esriSMS"
| "esriSFS"
| "esriPMS"
| "esriPFS"
| "esriTS";

/**
*
*/
export interface ISimpleFillSymbol extends ISymbol {
type: "esriSFS" | SymbolType.SFS;
style?:
| "esriSFSBackwardDiagonal"
| "esriSFSCross"
| "esriSFSDiagonalCross"
| "esriSFSForwardDiagonal"
| "esriSFSHorizontal"
| "esriSFSNull"
| "esriSFSSolid"
| "esriSFSVertical"
| SimpleFillSymbolStyle;
type: "esriSFS";
style?: SimpleFillSymbolStyle;
color?: Color;
outline?: ISimpleLineSymbol; // if outline has been specified
}
Expand All @@ -173,15 +133,8 @@ export interface ISimpleFillSymbol extends ISymbol {
*
*/
export interface ISimpleLineSymbol extends ISymbol {
type: "esriSLS" | SymbolType.SLS;
style?:
| "esriSLSDash"
| "esriSLSDashDot"
| "esriSLSDashDotDot"
| "esriSLSDot"
| "esriSLSNull"
| "esriSLSSolid"
| SimpleLineSymbolStyle;
type: "esriSLS";
style?: SimpleLineSymbolStyle;
color?: Color;
width?: number;
}
Expand All @@ -190,60 +143,26 @@ export interface ISimpleLineSymbol extends ISymbol {
*
*/
export interface ISimpleMarkerSymbol extends IMarkerSymbol {
type: "esriSMS" | SymbolType.SMS;
style?:
| "esriSMSCircle"
| "esriSMSCross"
| "esriSMSDiamond"
| "esriSMSSquare"
| "esriSMSX"
| "esriSMSTriangle"
| SimpleMarkerSymbolStyle;
type: "esriSMS";
style?: SimpleMarkerSymbolStyle;
color?: Color;
size?: number;
outline?: ISimpleLineSymbol;
}

/**
*
*/
export const enum VerticalAlignment {
Baseline = "baseline",
Top = "top",
Middle = "middle",
Bottom = "bottom"
}

export const enum HorizontalAlignment {
Left = "left",
Right = "right",
Center = "center",
Justify = "justify"
}

/**
*
*/
export interface ITextSymbol extends IMarkerSymbol {
type: "esriTS" | SymbolType.TS;
type: "esriTS";
color?: Color;
backgroundColor?: Color;
borderLineSize?: number; // <size>;
borderLineColor?: Color;
haloSize?: number; // <size>;
haloColor?: Color;
verticalAlignment?:
| "baseline"
| "top"
| "middle"
| "bottom"
| VerticalAlignment;
horizontalAlignment?:
| "left"
| "right"
| "center"
| "justify"
| HorizontalAlignment;
verticalAlignment?: "baseline" | "top" | "middle" | "bottom";
horizontalAlignment?: "left" | "right" | "center" | "justify";
rightToLeft?: boolean;
kerning?: boolean;
font?: IFont;
Expand Down
Loading

0 comments on commit ea218f0

Please sign in to comment.