Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@types/selectize] Add types for missing methods #69378

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions types/node/buffer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ declare module "buffer" {
copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
/**
* Returns a new `Buffer` that references the same memory as the original, but
* offset and cropped by the `start` and `end` indices.
* offset and cropped by the `start` and `end` indexes.
*
* This method is not compatible with the `Uint8Array.prototype.slice()`,
* which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
Expand Down Expand Up @@ -902,7 +902,7 @@ declare module "buffer" {
slice(start?: number, end?: number): Buffer;
/**
* Returns a new `Buffer` that references the same memory as the original, but
* offset and cropped by the `start` and `end` indices.
* offset and cropped by the `start` and `end` indexes.
*
* Specifying `end` greater than `buf.length` will return the same result as
* that of `end` equal to `buf.length`.
Expand Down Expand Up @@ -2256,7 +2256,7 @@ declare module "buffer" {
*/
includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
/**
* Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
* Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indexes).
*
* ```js
* import { Buffer } from 'node:buffer';
Expand Down
2 changes: 1 addition & 1 deletion types/node/dgram.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ declare module "dgram" {
*/
setBroadcast(flag: boolean): void;
/**
* _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC
* _All references to scope in this section are referring to [IPv6 Zone Indexes](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC
* 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_
* _with a scope index is written as `'IP%scope'` where scope is an interface name_
* _or interface number._
Expand Down
2 changes: 1 addition & 1 deletion types/node/events.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ declare module "events" {
* ```
*
* Because listeners are managed using an internal array, calling this will
* change the position indices of any listener registered _after_ the listener
* change the position indexes of any listener registered _after_ the listener
* being removed. This will not impact the order in which listeners are called,
* but it means that any copies of the listener array as returned by
* the `emitter.listeners()` method will need to be recreated.
Expand Down
15 changes: 15 additions & 0 deletions types/selectize/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,11 @@ declare namespace Selectize {
*/
addItem(value: T, silent?: boolean): void;

/**
* "Selects" multiple items at once. Adds them to the list at the current caret position.
*/
addItems(values: T, silent?: boolean): void;

/**
* Removes the selected item matching the provided value.
*/
Expand All @@ -500,6 +505,16 @@ declare namespace Selectize {
*/
addOptionGroup(id: string, data: U): void;

/**
* Clears all existing option groups.
*/
clearOptionGroups(): void;

/**
* Removes an existing option group.
*/
removeOptionGroup(id: string): void;

// Events
// ------------------------------------------------------------------------------------------------------------

Expand Down