DefinitelyTyped/types/bpmn-moddle/bpmn-moddle-tests.ts
Haydos e5c9bcdaea 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
2018-07-03 09:26:31 -07:00

25 lines
758 B
TypeScript

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;