Skip to content

Commit

Permalink
fix(types): add node.chosen (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomaash authored Jul 22, 2020
1 parent 2b1722f commit b1f636c
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions types/network/Network.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,47 @@ export interface Color {
};
}

export interface ChosenLabelValues {
color: string;
face: string;
mod: string;
size: number;
strokeColor: string;
strokeWidth: number;
vadjust: number;
}
export type NodeChosenLabelFunction = (
values: ChosenLabelValues,
id: IdType,
selected: boolean,
hovered: boolean
) => void;

export interface ChosenNodeValues {
borderColor: string;
borderDashes: boolean | number[];
borderRadius: number;
borderWidth: number;
color: string;
shadow: boolean;
shadowColor: string;
shadowSize: number;
shadowX: number;
shadowY: number;
size: number;
}
export type NodeChosenNodeFunction = (
values: ChosenNodeValues,
id: IdType,
selected: boolean,
hovered: boolean
) => void;

export interface NodeChosen {
node: boolean | NodeChosenNodeFunction;
label: boolean | NodeChosenLabelFunction;
}

export interface NodeOptions {
borderWidth?: number;

Expand All @@ -843,6 +884,8 @@ export interface NodeOptions {

color?: string | Color;

chosen?: boolean | NodeChosen;

opacity?: number;

fixed?: boolean | {
Expand Down

0 comments on commit b1f636c

Please sign in to comment.