Skip to content

Commit

Permalink
Add more TypeScript typings
Browse files Browse the repository at this point in the history
  • Loading branch information
kjellmf committed Jan 20, 2019
1 parent 1413f66 commit 9560f08
Showing 1 changed file with 48 additions and 6 deletions.
54 changes: 48 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
type ColorMode = {
civilian: string;
friend: string;
hostile: string;
neutral: string;
unknown: string;
Civilian: string;
Friend: string;
Hostile: string;
Neutral: string;
Unknown: string;
};

type SymbolOptions = {
Expand Down Expand Up @@ -49,7 +49,7 @@ type SymbolOptions = {
platformType?: string;
quantity?: string;
reinforcedReduced?: string;
sidc?:string;
sidc?: string;
sigint?: string;
signatureEquipment?: string;
simpleStatusModifier?: boolean;
Expand Down Expand Up @@ -125,5 +125,47 @@ export class Symbol {
toDataURL(): string;
}

interface Box {
x1: number,
y1: number,
x2: number,
y2: number,
}

interface BBoxObject extends Box {
width(): number,
height(): number,
/** Merges one box with another returns the original box */
merge(box: Box): this
}
/** Creates a bounding box object */
export function BBox(box?: Partial<Box>): BBoxObject;

/** Creates a ColorMode Object with colors used for different affiliations. */
export function ColorMode(civilian: string, friend: string, hostile: string, neutral: string, unknown: string): ColorMode;
/** Gets a color mode that has been registred with setColorMode */
export function getColorMode(mode: string): ColorMode;
/** Register a ColorMode with a name or override an existing ColorMode. */
export function setColorMode(name: string, colormode: ColorMode): ColorMode;

/** Gets the length of the HQ staf used for HQ symbols. */
export function getHqStaffLength(): number;
/** Sets the length of the HQ staf used for HQ symbols. */
export function setHqStaffLength(staff_length: number): number;


interface DashObject {
pending: string,
anticipated: string,
feintDummy: string
}
/** Gets the diffrent dash arrays used for dashed lines. */
export function getDashArrays(): DashObject;
/** Sets the dash arrays used for dashed lines */
export function setDashArrays(pending: string, anticipated: string, feintDummy: string): DashObject;

// Gets the version of milsymbol.
export function getVersion(): string;

/** Sets the preferred standard. */
export function setStandard(standard: "2525" | "APP6"): boolean;

0 comments on commit 9560f08

Please sign in to comment.