New typings for bpmn-moddle (#27005)

* Initial Typings for bpmn-moddle

* Removal of Camunda Typings from repository

* Header file and ensuring tslint extends correctly

* Fix for tslint extending incorrectly

* Removal of whitespace on line 1 for test runner.

* Removed all additional tslint rules. Added corresponding fixes to typings.

* Minor change to restart timing out build - Issue:20308
This commit is contained in:
Haydos 2018-07-04 02:26:31 +10:00 committed by Mohamed Hegazy
parent 2dd2e60a64
commit e5c9bcdaea
4 changed files with 1109 additions and 0 deletions

View File

@ -0,0 +1,24 @@
import * as BPMNModdle from "bpmn-moddle";
const moddle: BPMNModdle.Moddle = {} as any;
const element1 = moddle.create("bpmn:UserTask"); // Expect type User Task
element1.$type = "bpmn:UserTask"; // Expect to check against type correctly
const bpmnModdle: BPMNModdle.BPMNModdle = {} as any;
bpmnModdle.fromXML("", (err, definitions, parseContext) => {
err; // type of error
definitions; // type of definition
parseContext; // type of any
});
const definition: BPMNModdle.Definitions = {} as any;
// Expect type of process or undefined
const maybeProcess = definition.rootElements.find(
i => i.$type === "bpmn:Process"
);
// Expect process to have additional typings to base element1
const process = maybeProcess as BPMNModdle.Process;

1068
types/bpmn-moddle/index.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "bpmn-moddle-tests.ts"]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }