Socket
Socket
Sign inDemoInstall

@types/vis

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/vis - npm Package Compare versions

Comparing version 4.18.9 to 4.21.0

288

vis/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for vis.js 4.18
// Type definitions for vis.js 4.21
// Project: https://github.com/almende/vis

@@ -10,2 +10,3 @@ // Definitions by: Michaël Bitard <https://github.com/MichaelBitard>

// Adam Lewis <https://github.com/supercargo>
// Alex Soh <https://github.com/takato1314>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

@@ -15,5 +16,5 @@

export type MomentConstructor1 =
(inp?: MomentInput, format?: MomentFormatSpecification, strict?: boolean) => Moment;
(inp?: MomentInput, format?: MomentFormatSpecification, strict?: boolean) => Moment;
export type MomentConstructor2 =
(inp?: MomentInput, format?: MomentFormatSpecification, language?: string, strict?: boolean) => Moment;
(inp?: MomentInput, format?: MomentFormatSpecification, language?: string, strict?: boolean) => Moment;

@@ -26,3 +27,3 @@ export type MomentConstructor = MomentConstructor1 | MomentConstructor2;

export type HeightWidthType = IdType;
export type TimelineItemType = 'box'| 'point' | 'range' | 'background';
export type TimelineItemType = 'box' | 'point' | 'range' | 'background';
export type TimelineAlignType = 'auto' | 'center' | 'left' | 'right';

@@ -275,23 +276,62 @@ export type TimelineTimeAxisScaleType = 'millisecond' | 'second' | 'minute' | 'hour' |

export interface TimelineFitAnimation {
duration?: number;
easingFunction?: string;
/**
* If true (default) or an Object, the range is animated smoothly to the new window.
* An object can be provided to specify duration and easing function.
* Default duration is 500 ms, and default easing function is 'easeInOutQuad'.
*/
export type TimelineAnimationType = boolean | AnimationOptions;
export interface TimelineAnimationOptions {
animation?: TimelineAnimationType;
}
export type TimelineFitAnimationType = boolean | TimelineFitAnimation;
export interface TimelineEventPropertiesResult {
/**
* The id of the clicked group
*/
group?: number | null;
export interface TimelineFitOptions {
animation?: TimelineFitAnimationType;
}
/**
* The id of the clicked item.
*/
item?: number | null;
export interface TimelineEventPropertiesResult {
group?: number;
item?: number;
/**
* Absolute horizontal position of the click event.
*/
pageX: number;
/**
* Absolute vertical position of the click event.
*/
pageY: number;
/**
* Relative horizontal position of the click event.
*/
x: number;
/**
* Relative vertical position of the click event.
*/
y: number;
/**
* Date of the clicked event.
*/
time: Date;
/**
* Date of the clicked event, snapped to a nice value.
*/
snappedTime: Date;
/**
* Name of the clicked thing.
*/
what?: TimelineEventPropertiesResultWhatType;
/**
* The original click event.
*/
event: Event;

@@ -681,4 +721,4 @@ }

destroy(): void;
fit(options?: TimelineFitOptions): void;
focus(ids: IdType | IdType[], options?: TimelineFitOptions): void;
fit(options?: TimelineAnimationOptions): void;
focus(ids: IdType | IdType[], options?: TimelineAnimationOptions): void;
getCurrentTime(): Date;

@@ -691,3 +731,3 @@ getCustomTime(id?: IdType): Date;

getWindow(): { start: Date, end: Date };
moveTo(time: DateType, options?: TimelineFitOptions): void;
moveTo(time: DateType, options?: TimelineAnimationOptions): void;
on(event: TimelineEvents, callback: () => void): void;

@@ -705,3 +745,3 @@ off(event: TimelineEvents, callback: () => void): void;

setSelection(ids: IdType | IdType[]): void;
setWindow(start: DateType, end: DateType, options?: TimelineFitOptions): void;
setWindow(start: DateType, end: DateType, options?: TimelineAnimationOptions): void;
}

@@ -726,2 +766,3 @@

);
constructor(

@@ -733,31 +774,163 @@ container: HTMLElement,

/**
* Add new vertical bar representing a custom time that can be dragged by the user. Parameter time can be a Date, Number, or String, and is new Date() by default.
* Parameter id can be Number or String and is undefined by default. The id is added as CSS class name of the custom time bar, allowing to style multiple time bars differently.
* The method returns id of the created bar.
*/
addCustomTime(time: DateType, id?: IdType): IdType;
/**
* Destroy the Timeline. The timeline is removed from memory. all DOM elements and event listeners are cleaned up.
*/
destroy(): void;
fit(options?: TimelineFitOptions): void;
focus(ids: IdType | IdType[], options?: TimelineFitOptions): void;
/**
* Adjust the visible window such that it fits all items. See also focus(id).
*/
fit(options?: TimelineAnimationOptions): void;
/**
* Adjust the visible window such that the selected item (or multiple items) are centered on screen. See also function fit()
*/
focus(ids: IdType | IdType[], options?: TimelineAnimationOptions): void;
/**
* Get the current time. Only applicable when option showCurrentTime is true.
*/
getCurrentTime(): Date;
/**
* Retrieve the custom time from the custom time bar with given id.
* @param id Id is undefined by default.
*/
getCustomTime(id?: IdType): Date;
getEventProperties(event: Event): TimelineEventPropertiesResult;
/**
* Get the range of all the items as an object containing min date and max date
*/
getItemRange(): { min: Date, max: Date };
/**
* Get an array with the ids of the currently selected items
*/
getSelection(): IdType[];
/**
* Get an array with the ids of the currently visible items.
*/
getVisibleItems(): IdType[];
/**
* Get the current visible window.
*/
getWindow(): TimelineWindow;
moveTo(time: DateType, options?: TimelineFitOptions): void;
on(event: TimelineEvents, callback: () => void): void;
off(event: TimelineEvents, callback: () => void): void;
/**
* Move the window such that given time is centered on screen.
*/
moveTo(time: DateType, options?: TimelineAnimationOptions, callback?: (properties?: any) => void): void;
/**
* Create an event listener. The callback function is invoked every time the event is triggered.
*/
on(event: TimelineEvents, callback?: (properties?: any) => void): void;
/**
* Remove an event listener created before via function on(event[, callback]).
*/
off(event: TimelineEvents, callback?: (properties?: any) => void): void;
/**
* Force a redraw of the Timeline. The size of all items will be recalculated.
* Can be useful to manually redraw when option autoResize=false and the window has been resized, or when the items CSS has been changed.
*/
redraw(): void;
/**
* Remove vertical bars previously added to the timeline via addCustomTime method.
* @param id ID of the custom vertical bar returned by addCustomTime method.
*/
removeCustomTime(id: IdType): void;
/**
* Set a current time. This can be used for example to ensure that a client's time is synchronized with a shared server time. Only applicable when option showCurrentTime is true.
*/
setCurrentTime(time: DateType): void;
/**
* Adjust the time of a custom time bar.
* @param time The time the custom time bar should point to
* @param id Id of the custom time bar, and is undefined by default.
*/
setCustomTime(time: DateType, id?: IdType): void;
/**
* Adjust the title attribute of a custom time bar.
* @param title The title shown when hover over time bar
* @param id Id of the custom time bar, and is undefined by default.
*/
setCustomTimeTitle(title: string, id?: IdType): void;
/**
* Set both groups and items at once. Both properties are optional.
* This is a convenience method for individually calling both setItems(items) and setGroups(groups).
* Both items and groups can be an Array with Objects, a DataSet (offering 2 way data binding), or a DataView (offering 1 way data binding).
*/
setData(data: { groups?: DataGroupCollectionType; items?: DataItemCollectionType }): void;
/**
* Set a data set with groups for the Timeline.
*/
setGroups(groups?: DataGroupCollectionType): void;
/**
* Set a data set with items for the Timeline.
*/
setItems(items: DataItemCollectionType): void;
/**
* Set or update options. It is possible to change any option of the timeline at any time. You can for example switch orientation on the fly.
*/
setOptions(options: TimelineOptions): void;
setSelection(ids: IdType | IdType[]): void;
setWindow(start: DateType, end: DateType, options?: TimelineFitOptions, callback?: () => void): void;
/**
* Select one or multiple items by their id. The currently selected items will be unselected. To unselect all selected items, call `setSelection([])`.
*/
setSelection(ids: IdType | IdType[], options?: { focus: boolean, animation: TimelineAnimationOptions }): void;
/**
* Set the current visible window.
* @param start If the parameter value of start is null, the parameter will be left unchanged.
* @param end If the parameter value of end is null, the parameter will be left unchanged.
* @param options Timeline animation options. See {@link TimelineAnimationOptions}
* @param callback The callback function
*/
setWindow(start: DateType, end: DateType, options?: TimelineAnimationOptions, callback?: () => void): void;
/**
* Toggle rollingMode.
*/
toggleRollingMode(): void;
/**
* Zoom in the current visible window.
* @param percentage A number and must be between 0 and 1. If null, the window will be left unchanged.
* @param options Timeline animation options. See {@link TimelineAnimationOptions}
* @param callback The callback function
*/
zoomIn(percentage: number, options?: TimelineAnimationOptions, callback?: () => void): void;
/**
* Zoom out the current visible window.
* @param percentage A number and must be between 0 and 1. If null, the window will be left unchanged.
* @param options Timeline animation options. See {@link TimelineAnimationOptions}
* @param callback The callback function
*/
zoomOut(percentage: number, options?: TimelineAnimationOptions, callback?: () => void): void;
}
export interface TimelineStatic {
new (id: HTMLElement, data: any, options?: any): vis.Timeline;
new(id: HTMLElement, data: any, options?: any): vis.Timeline;
}

@@ -772,2 +945,3 @@

on(event?: string, callback?: (properties: any) => void): void;
off(event: string, callback?: (properties?: any) => void): void;
}

@@ -1373,5 +1547,20 @@

*/
easingFunction: string;
easingFunction: EasingFunction;
}
export type EasingFunction =
'linear' |
'easeInQuad' |
'easeOutQuad' |
'easeInOutQuad' |
'easeInCubic' |
'easeOutCubic' |
'easeInOutCubic' |
'easeInQuart' |
'easeOutQuart' |
'easeInOutQuart' |
'easeInQuint' |
'easeOutQuint' |
'easeInOutQuint';
/**

@@ -1390,3 +1579,3 @@ * Optional options for the fit method.

*/
animation: AnimationOptions | boolean;
animation: TimelineAnimationType;
}

@@ -1524,26 +1713,27 @@

export interface Locales {
[language: string]: LocaleMessages | undefined;
en?: LocaleMessages;
de?: LocaleMessages;
es?: LocaleMessages;
it?: LocaleMessages;
nl?: LocaleMessages;
'pt-br'?: LocaleMessages;
ru?: LocaleMessages;
[language: string]: LocaleMessages | undefined;
en?: LocaleMessages;
cn?: LocaleMessages;
de?: LocaleMessages;
es?: LocaleMessages;
it?: LocaleMessages;
nl?: LocaleMessages;
'pt-br'?: LocaleMessages;
ru?: LocaleMessages;
}
export interface LocaleMessages {
edit: string;
del: string;
back: string;
addNode: string;
addEdge: string;
editNode: string;
editEdge: string;
addDescription: string;
edgeDescription: string;
editEdgeDescription: string;
createEdgeError: string;
deleteClusterError: string;
editClusterError: string;
edit: string;
del: string;
back: string;
addNode: string;
addEdge: string;
editNode: string;
editEdge: string;
addDescription: string;
edgeDescription: string;
editEdgeDescription: string;
createEdgeError: string;
deleteClusterError: string;
editClusterError: string;
}

@@ -1550,0 +1740,0 @@

9

vis/package.json
{
"name": "@types/vis",
"version": "4.18.9",
"version": "4.21.0",
"description": "TypeScript definitions for vis.js",

@@ -41,2 +41,7 @@ "license": "MIT",

"githubUsername": "supercargo"
},
{
"name": "Alex Soh",
"url": "https://github.com/takato1314",
"githubUsername": "takato1314"
}

@@ -53,4 +58,4 @@ ],

},
"typesPublisherContentHash": "44950282ddbf5f913edabc739c5a6e17ca05669b5a78112e49ace3f166f1dc06",
"typesPublisherContentHash": "712b0110a77188ce1d47525cfcb3ecf1def7228f192be7ba3337c0da202d82f9",
"typeScriptVersion": "2.0"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Thu, 26 Oct 2017 15:07:04 GMT
* Last updated: Tue, 14 Nov 2017 00:06:04 GMT
* Dependencies: moment

@@ -17,2 +17,2 @@ * Global values: vis

# Credits
These definitions were written by Michaël Bitard <https://github.com/MichaelBitard>, MacLeod Broad <https://github.com/macleodbroad-wf>, Adrian Caballero <https://github.com/adripanico>, Severin <https://github.com/seveves>, kaktus40 <https://github.com/kaktus40>, Matthieu Maitre <https://github.com/mmaitre314>, Adam Lewis <https://github.com/supercargo>.
These definitions were written by Michaël Bitard <https://github.com/MichaelBitard>, MacLeod Broad <https://github.com/macleodbroad-wf>, Adrian Caballero <https://github.com/adripanico>, Severin <https://github.com/seveves>, kaktus40 <https://github.com/kaktus40>, Matthieu Maitre <https://github.com/mmaitre314>, Adam Lewis <https://github.com/supercargo>, Alex Soh <https://github.com/takato1314>.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc