Skip to content

Commit

Permalink
chore: update typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
k0stik committed Nov 27, 2024
1 parent 7d2be81 commit d77ba96
Show file tree
Hide file tree
Showing 49 changed files with 457 additions and 521 deletions.
28 changes: 14 additions & 14 deletions dist/js/constants.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
export namespace coefficients {
const EV_TO_RY: number;
const BOHR_TO_ANGSTROM: number;
const ANGSTROM_TO_BOHR: number;
const EV_A_TO_RY_BOHR: number;
let EV_TO_RY: number;
let BOHR_TO_ANGSTROM: number;
let ANGSTROM_TO_BOHR: number;
let EV_A_TO_RY_BOHR: number;
}
export namespace tolerance {
const length: number;
const lengthAngstrom: number;
const pointsDistance: number;
let length: number;
let lengthAngstrom: number;
let pointsDistance: number;
}
export namespace units {
const bohr: string;
const angstrom: string;
const degree: string;
const radian: string;
const alat: string;
let bohr: string;
let angstrom: string;
let degree: string;
let radian: string;
let alat: string;
}
export namespace ATOMIC_COORD_UNITS {
const crystal: string;
const cartesian: string;
let crystal: string;
let cartesian: string;
}
export const HASH_TOLERANCE: 3;
declare namespace _default {
Expand Down
10 changes: 5 additions & 5 deletions dist/js/context/mixins.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export declare function MaterialContextMixin<T extends Constructor>(superclass:
_material: Material;
extraData?: {
materialHash: string;
} | undefined;
isEdited?: boolean | undefined;
};
isEdited?: boolean;
readonly isEditedIsSetToFalseOnMaterialUpdate: boolean;
updateMaterialHash(): void;
readonly isMaterialCreatedDefault: boolean;
Expand Down Expand Up @@ -46,10 +46,10 @@ export declare function MethodDataContextMixin<T extends Constructor>(superclass
[x: string]: any;
_methodData: any;
isEdited: boolean;
methodDataHash?: string | undefined;
methodDataHash?: string;
extraData?: {
methodDataHash?: string | undefined;
} | undefined;
methodDataHash?: string;
};
_initMethodDataHash(): void;
readonly methodData: any;
readonly isMethodDataUpdated: boolean;
Expand Down
15 changes: 7 additions & 8 deletions dist/js/context/mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.JobContextMixin = exports.WorkflowContextMixin = exports.MethodDataContextMixin = exports.MaterialsContextMixin = exports.MaterialsSetContextMixin = exports.MaterialContextMixin = exports.ApplicationContextMixin = void 0;
exports.ApplicationContextMixin = ApplicationContextMixin;
exports.MaterialContextMixin = MaterialContextMixin;
exports.MaterialsSetContextMixin = MaterialsSetContextMixin;
exports.MaterialsContextMixin = MaterialsContextMixin;
exports.MethodDataContextMixin = MethodDataContextMixin;
exports.WorkflowContextMixin = WorkflowContextMixin;
exports.JobContextMixin = JobContextMixin;
const crypto_js_1 = __importDefault(require("crypto-js"));
const utils_1 = require("../entity/set/ordered/utils");
function ApplicationContextMixin(superclass) {
Expand All @@ -25,7 +31,6 @@ function ApplicationContextMixin(superclass) {
}
};
}
exports.ApplicationContextMixin = ApplicationContextMixin;
function MaterialContextMixin(superclass) {
return class MaterialContextMixin extends superclass {
constructor(...args) {
Expand Down Expand Up @@ -64,7 +69,6 @@ function MaterialContextMixin(superclass) {
}
};
}
exports.MaterialContextMixin = MaterialContextMixin;
function MaterialsSetContextMixin(superclass) {
return class MaterialsSetContextMixin extends superclass {
constructor(...params) {
Expand All @@ -82,7 +86,6 @@ function MaterialsSetContextMixin(superclass) {
}
};
}
exports.MaterialsSetContextMixin = MaterialsSetContextMixin;
function MaterialsContextMixin(superclass) {
return class MaterialsContextMixin extends superclass {
constructor(...params) {
Expand All @@ -103,7 +106,6 @@ function MaterialsContextMixin(superclass) {
}
};
}
exports.MaterialsContextMixin = MaterialsContextMixin;
function MethodDataContextMixin(superclass) {
return class extends superclass {
constructor(...params) {
Expand Down Expand Up @@ -142,7 +144,6 @@ function MethodDataContextMixin(superclass) {
}
};
}
exports.MethodDataContextMixin = MethodDataContextMixin;
function WorkflowContextMixin(superclass) {
return class extends superclass {
constructor(...params) {
Expand All @@ -156,7 +157,6 @@ function WorkflowContextMixin(superclass) {
}
};
}
exports.WorkflowContextMixin = WorkflowContextMixin;
function JobContextMixin(superclass) {
return class extends superclass {
constructor(...params) {
Expand All @@ -170,4 +170,3 @@ function JobContextMixin(superclass) {
}
};
}
exports.JobContextMixin = JobContextMixin;
2 changes: 1 addition & 1 deletion dist/js/context/registry.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export class ContextProviderRegistryContainer {
_providers: any[];
set providers(arg: any[]);
set providers(p: any[]);
get providers(): any[];
addProvider({ name, instance }: {
name: any;
Expand Down
26 changes: 18 additions & 8 deletions dist/js/entity/in_memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Expand All @@ -35,7 +45,7 @@ const clone_1 = require("../utils/clone");
var ValidationErrorCode;
(function (ValidationErrorCode) {
ValidationErrorCode["IN_MEMORY_ENTITY_DATA_INVALID"] = "IN_MEMORY_ENTITY_DATA_INVALID";
})(ValidationErrorCode = exports.ValidationErrorCode || (exports.ValidationErrorCode = {}));
})(ValidationErrorCode || (exports.ValidationErrorCode = ValidationErrorCode = {}));
class EntityError extends Error {
constructor({ code, details }) {
super(code);
Expand Down
24 changes: 17 additions & 7 deletions dist/js/entity/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlowchartItemMixin = exports.FlowchartEntityMixin = exports.ContextAndRenderFieldsMixin = exports.OrderedInMemoryEntityInSetMixin = exports.OrderedInMemoryEntitySetMixin = exports.InMemoryEntityInSetMixin = exports.InMemoryEntitySetMixin = exports.selectorsForEntitySet = exports.constructEntitySetFactoryByConfig = exports.ENTITY_SET_TYPES = exports.InMemoryEntitySet = exports.HashedInputArrayMixin = exports.RuntimeContextFieldMixin = exports.RuntimeItemsMixin = exports.NamedEntityMixin = exports.HasScopeTrackMixin = exports.TaggableMixin = exports.HasMetadataMixin = exports.HasDescriptionMixin = exports.DefaultableMixin = exports.HasConsistencyChecksMixin = exports.HasConsistencyChecksHasMetadataNamedDefaultableInMemoryEntity = exports.NamedDefaultableRepetitionRuntimeItemsImportantSettingsContextAndRenderHashedInMemoryEntity = exports.NamedDefaultableRepetitionImportantSettingsInMemoryEntity = exports.NamedDefaultableRepetitionContextAndRenderInMemoryEntity = exports.HasMetadataNamedDefaultableInMemoryEntity = exports.NamedDefaultableInMemoryEntity = exports.DefaultableInMemoryEntity = exports.NamedInMemoryEntity = exports.InMemoryEntity = void 0;
const in_memory_1 = require("./in_memory");
Expand Down
18 changes: 9 additions & 9 deletions dist/js/entity/mixins/context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export declare function ContextAndRenderFieldsMixin<T extends InMemoryEntityCons
render(_context?: AnyObject): void;
_json: AnyObject;
prop<T_1 = undefined>(name: string, defaultValue: T_1): T_1;
prop<T_2 = undefined>(name: string): T_2 | undefined;
prop<T_1 = undefined>(name: string): T_1 | undefined;
setProp(name: string, value: unknown): void;
unsetProp(name: string): void;
setProps(json?: AnyObject): any;
setProps(json?: AnyObject): /*elided*/ any;
toJSON(exclude?: string[]): AnyObject;
toJSONSafe(exclude?: string[]): AnyObject;
toJSONQuick(exclude?: string[]): AnyObject;
clone(extraContext?: object | undefined): any;
clone(extraContext?: object): /*elided*/ any;
validate(): void;
clean(config: AnyObject): AnyObject;
isValid(): boolean;
Expand All @@ -46,14 +46,14 @@ export declare function DomainContextProviderMixin<T extends InMemoryEntityConst
readonly contextProviders: ContextProvider[];
_json: AnyObject;
prop<T_1 = undefined>(name: string, defaultValue: T_1): T_1;
prop<T_2 = undefined>(name: string): T_2 | undefined;
prop<T_1 = undefined>(name: string): T_1 | undefined;
setProp(name: string, value: unknown): void;
unsetProp(name: string): void;
setProps(json?: AnyObject): any;
setProps(json?: AnyObject): /*elided*/ any;
toJSON(exclude?: string[]): AnyObject;
toJSONSafe(exclude?: string[]): AnyObject;
toJSONQuick(exclude?: string[]): AnyObject;
clone(extraContext?: object | undefined): any;
clone(extraContext?: object): /*elided*/ any;
validate(): void;
clean(config: AnyObject): AnyObject;
isValid(): boolean;
Expand All @@ -79,14 +79,14 @@ export declare function ImportantSettingsProviderMixin<T extends InMemoryEntityC
readonly contextProviders: ContextProvider[];
_json: AnyObject;
prop<T_1 = undefined>(name: string, defaultValue: T_1): T_1;
prop<T_2 = undefined>(name: string): T_2 | undefined;
prop<T_1 = undefined>(name: string): T_1 | undefined;
setProp(name: string, value: unknown): void;
unsetProp(name: string): void;
setProps(json?: AnyObject): any;
setProps(json?: AnyObject): /*elided*/ any;
toJSON(exclude?: string[]): AnyObject;
toJSONSafe(exclude?: string[]): AnyObject;
toJSONQuick(exclude?: string[]): AnyObject;
clone(extraContext?: object | undefined): any;
clone(extraContext?: object): /*elided*/ any;
validate(): void;
clean(config: AnyObject): AnyObject;
isValid(): boolean;
Expand Down
7 changes: 3 additions & 4 deletions dist/js/entity/mixins/context.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImportantSettingsProviderMixin = exports.DomainContextProviderMixin = exports.ContextAndRenderFieldsMixin = void 0;
exports.ContextAndRenderFieldsMixin = ContextAndRenderFieldsMixin;
exports.DomainContextProviderMixin = DomainContextProviderMixin;
exports.ImportantSettingsProviderMixin = ImportantSettingsProviderMixin;
const clone_1 = require("../../utils/clone");
function ContextAndRenderFieldsMixin(superclass) {
return class extends superclass {
Expand Down Expand Up @@ -44,7 +46,6 @@ function ContextAndRenderFieldsMixin(superclass) {
}
};
}
exports.ContextAndRenderFieldsMixin = ContextAndRenderFieldsMixin;
/*
* @summary Handles logic for domain-specific context, eg. "important settings".
* Important settings are stored inside "important" property and have context providers associated with it.
Expand All @@ -62,7 +63,6 @@ function DomainContextProviderMixin(superclass) {
}
};
}
exports.DomainContextProviderMixin = DomainContextProviderMixin;
function ImportantSettingsProviderMixin(superclass) {
return class extends DomainContextProviderMixin(superclass) {
get important() {
Expand All @@ -82,4 +82,3 @@ function ImportantSettingsProviderMixin(superclass) {
}
};
}
exports.ImportantSettingsProviderMixin = ImportantSettingsProviderMixin;
8 changes: 4 additions & 4 deletions dist/js/entity/mixins/context_runtime.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ type RuntimeContext = Required<JobBaseSchema>["runtimeContext"];
export declare function RuntimeContextFieldMixin<T extends InMemoryEntityConstructor>(superclass: T): {
new (...args: any[]): {
_runtimeContext: RuntimeContext;
runtimeContext: {};
runtimeContext: RuntimeContext;
updateRuntimeContext(ctx?: RuntimeContext): void;
toJSON(exclude?: string[]): {
runtimeContext: {};
};
_json: import("@mat3ra/esse/dist/js/esse/types").AnyObject;
prop<T_1 = undefined>(name: string, defaultValue: T_1): T_1;
prop<T_2 = undefined>(name: string): T_2 | undefined;
prop<T_1 = undefined>(name: string): T_1 | undefined;
setProp(name: string, value: unknown): void;
unsetProp(name: string): void;
setProps(json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject): any;
setProps(json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject): /*elided*/ any;
toJSONSafe(exclude?: string[]): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
toJSONQuick(exclude?: string[]): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
clone(extraContext?: object | undefined): any;
clone(extraContext?: object): /*elided*/ any;
validate(): void;
clean(config: import("@mat3ra/esse/dist/js/esse/types").AnyObject): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
isValid(): boolean;
Expand Down
3 changes: 1 addition & 2 deletions dist/js/entity/mixins/context_runtime.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RuntimeContextFieldMixin = void 0;
exports.RuntimeContextFieldMixin = RuntimeContextFieldMixin;
function RuntimeContextFieldMixin(superclass) {
return class extends superclass {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -24,4 +24,3 @@ function RuntimeContextFieldMixin(superclass) {
}
};
}
exports.RuntimeContextFieldMixin = RuntimeContextFieldMixin;
12 changes: 6 additions & 6 deletions dist/js/entity/mixins/flowchart.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export declare function FlowchartItemMixin<T extends InMemoryEntityConstructor>(
next: string | undefined;
_json: import("@mat3ra/esse/dist/js/esse/types").AnyObject;
prop<T_1 = undefined>(name: string, defaultValue: T_1): T_1;
prop<T_2 = undefined>(name: string): T_2 | undefined;
prop<T_1 = undefined>(name: string): T_1 | undefined;
setProp(name: string, value: unknown): void;
unsetProp(name: string): void;
setProps(json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject): any;
setProps(json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject): /*elided*/ any;
toJSON(exclude?: string[]): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
toJSONSafe(exclude?: string[]): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
toJSONQuick(exclude?: string[]): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
clone(extraContext?: object | undefined): any;
clone(extraContext?: object): /*elided*/ any;
validate(): void;
clean(config: import("@mat3ra/esse/dist/js/esse/types").AnyObject): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
isValid(): boolean;
Expand Down Expand Up @@ -42,14 +42,14 @@ export declare function FlowchartEntityMixin<T extends InMemoryEntityConstructor
getUnitIndexByFlowchartId(flowchartId: string): number;
_json: import("@mat3ra/esse/dist/js/esse/types").AnyObject;
prop<T_1 = undefined>(name: string, defaultValue: T_1): T_1;
prop<T_2 = undefined>(name: string): T_2 | undefined;
prop<T_1 = undefined>(name: string): T_1 | undefined;
setProp(name: string, value: unknown): void;
unsetProp(name: string): void;
setProps(json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject): any;
setProps(json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject): /*elided*/ any;
toJSON(exclude?: string[]): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
toJSONSafe(exclude?: string[]): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
toJSONQuick(exclude?: string[]): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
clone(extraContext?: object | undefined): any;
clone(extraContext?: object): /*elided*/ any;
validate(): void;
clean(config: import("@mat3ra/esse/dist/js/esse/types").AnyObject): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
isValid(): boolean;
Expand Down
5 changes: 2 additions & 3 deletions dist/js/entity/mixins/flowchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlowchartEntityMixin = exports.FlowchartItemMixin = void 0;
exports.FlowchartItemMixin = FlowchartItemMixin;
exports.FlowchartEntityMixin = FlowchartEntityMixin;
const findIndex_1 = __importDefault(require("lodash/findIndex"));
const utils_1 = require("../../utils");
function FlowchartItemMixin(superclass) {
Expand Down Expand Up @@ -33,7 +34,6 @@ function FlowchartItemMixin(superclass) {
}
};
}
exports.FlowchartItemMixin = FlowchartItemMixin;
function FlowchartEntityMixin(superclass) {
return class extends superclass {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down Expand Up @@ -67,4 +67,3 @@ function FlowchartEntityMixin(superclass) {
}
};
}
exports.FlowchartEntityMixin = FlowchartEntityMixin;
Loading

0 comments on commit d77ba96

Please sign in to comment.