UNPKG

@bitbybit-dev/core

Version:

Bit By Bit Developers Core CAD API to Program Geometry

154 lines (153 loc) 4.31 kB
/* eslint-disable @typescript-eslint/no-namespace */ export var JSON; (function (JSON) { class StringifyDto { constructor(json) { if (json !== undefined) { this.json = json; } } } JSON.StringifyDto = StringifyDto; class ParseDto { constructor(text) { /** * Stringify value * @default "[0, 0, 0]" */ this.text = "[0, 0, 0]"; if (text !== undefined) { this.text = text; } } } JSON.ParseDto = ParseDto; class QueryDto { constructor(json, query) { if (json !== undefined) { this.json = json; } if (query !== undefined) { this.query = query; } } } JSON.QueryDto = QueryDto; class SetValueOnPropDto { constructor(json, value, property) { /** * query json structure * @default propName */ this.property = "propName"; if (json !== undefined) { this.json = json; } if (value !== undefined) { this.value = value; } if (property !== undefined) { this.property = property; } } } JSON.SetValueOnPropDto = SetValueOnPropDto; class GetJsonFromArrayByFirstPropMatchDto { constructor(jsonArray, property, match) { /** * property to check * @default propName */ this.property = "propName"; if (jsonArray !== undefined) { this.jsonArray = jsonArray; } if (property !== undefined) { this.property = property; } if (match !== undefined) { this.match = match; } } } JSON.GetJsonFromArrayByFirstPropMatchDto = GetJsonFromArrayByFirstPropMatchDto; class GetValueOnPropDto { constructor(json, property) { /** * query json structure * @default propName */ this.property = "propName"; if (json !== undefined) { this.json = json; } if (property !== undefined) { this.property = property; } } } JSON.GetValueOnPropDto = GetValueOnPropDto; class SetValueDto { constructor(json, value, path, prop) { /** * query to json structure elements on which given prop has to be updated * @default $.pathToParent */ this.path = "$.pathToParent"; /** * property to update * @default propertyName */ this.prop = "propertyName"; if (json !== undefined) { this.json = json; } if (value !== undefined) { this.value = value; } if (path !== undefined) { this.path = path; } if (prop !== undefined) { this.prop = prop; } } } JSON.SetValueDto = SetValueDto; class SetValuesOnPathsDto { constructor(json, values, paths, props) { if (json !== undefined) { this.json = json; } if (values !== undefined) { this.values = values; } if (paths !== undefined) { this.paths = paths; } if (props !== undefined) { this.props = props; } } } JSON.SetValuesOnPathsDto = SetValuesOnPathsDto; class PathsDto { constructor(json, query) { if (json !== undefined) { this.json = json; } if (query !== undefined) { this.query = query; } } } JSON.PathsDto = PathsDto; class JsonDto { constructor(json) { if (json !== undefined) { this.json = json; } } } JSON.JsonDto = JsonDto; })(JSON || (JSON = {}));