Skip to content

Commit

Permalink
Update API
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Aug 16, 2022
1 parent 9c145ef commit ea51ff3
Show file tree
Hide file tree
Showing 15 changed files with 1,063 additions and 473 deletions.
30 changes: 14 additions & 16 deletions review/api/algorithm.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class ArrayIterator<T> implements IIterator<T> {
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
}
}

// @public
export function chain<T>(...objects: IterableOrArrayLike<T>[]): IIterator<T>;
Expand All @@ -64,7 +64,7 @@ export class ChainIterator<T> implements IIterator<T> {
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
}
}

// @public
export function each<T>(object: IterableOrArrayLike<T>, fn: (value: T, index: number) => boolean | void): void;
Expand All @@ -74,7 +74,6 @@ export function empty<T>(): IIterator<T>;

// @public
export class EmptyIterator<T> implements IIterator<T> {
constructor();
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
Expand All @@ -89,7 +88,7 @@ export class EnumerateIterator<T> implements IIterator<[number, T]> {
clone(): IIterator<[number, T]>;
iter(): IIterator<[number, T]>;
next(): [number, T] | undefined;
}
}

// @public
export function every<T>(object: IterableOrArrayLike<T>, fn: (value: T, index: number) => boolean): boolean;
Expand All @@ -103,7 +102,7 @@ export class FilterIterator<T> implements IIterator<T> {
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
}
}

// @public
export function find<T>(object: IterableOrArrayLike<T>, fn: (value: T, index: number) => boolean): T | undefined;
Expand Down Expand Up @@ -143,7 +142,7 @@ export class ItemIterator<T> implements IIterator<[string, T]> {
clone(): IIterator<[string, T]>;
iter(): IIterator<[string, T]>;
next(): [string, T] | undefined;
}
}

// @public
export function iter<T>(object: IterableOrArrayLike<T>): IIterator<T>;
Expand Down Expand Up @@ -177,7 +176,7 @@ export class KeyIterator implements IIterator<string> {
clone(): IIterator<string>;
iter(): IIterator<string>;
next(): string | undefined;
}
}

// @public
export function map<T, U>(object: IterableOrArrayLike<T>, fn: (value: T, index: number) => U): IIterator<U>;
Expand All @@ -188,7 +187,7 @@ export class MapIterator<T, U> implements IIterator<U> {
clone(): IIterator<U>;
iter(): IIterator<U>;
next(): U | undefined;
}
}

// @public
export function max<T>(object: IterableOrArrayLike<T>, fn: (first: T, second: T) => number): T | undefined;
Expand All @@ -211,7 +210,7 @@ export class RangeIterator implements IIterator<number> {
clone(): IIterator<number>;
iter(): IIterator<number>;
next(): number | undefined;
}
}

// @public
export function reduce<T>(object: IterableOrArrayLike<T>, fn: (accumulator: T, value: T, index: number) => T): T;
Expand All @@ -228,7 +227,7 @@ export class RepeatIterator<T> implements IIterator<T> {
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
}
}

// @public
export function retro<T>(object: RetroableOrArrayLike<T>): IIterator<T>;
Expand All @@ -242,7 +241,7 @@ export class RetroArrayIterator<T> implements IIterator<T> {
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
}
}

// @public
export function some<T>(object: IterableOrArrayLike<T>, fn: (value: T, index: number) => boolean): boolean;
Expand All @@ -256,7 +255,7 @@ export class StrideIterator<T> implements IIterator<T> {
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
}
}

// @public
export namespace StringExt {
Expand All @@ -280,7 +279,7 @@ export class TakeIterator<T> implements IIterator<T> {
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
}
}

// @public
export function toArray<T>(object: IterableOrArrayLike<T>): T[];
Expand All @@ -301,7 +300,7 @@ export class ValueIterator<T> implements IIterator<T> {
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
}
}

// @public
export function zip<T>(...objects: IterableOrArrayLike<T>[]): IIterator<T[]>;
Expand All @@ -312,8 +311,7 @@ export class ZipIterator<T> implements IIterator<T[]> {
clone(): IIterator<T[]>;
iter(): IIterator<T[]>;
next(): T[] | undefined;
}

}

// (No @packageDocumentation comment for this package)

Expand Down
5 changes: 2 additions & 3 deletions review/api/application.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export class Application<T extends Widget> {
resolveRequiredService<U>(token: Token<U>): Promise<U>;
readonly shell: T;
start(options?: Application.IStartOptions): Promise<void>;
readonly started: Promise<void>;
}
get started(): Promise<void>;
}

// @public
export namespace Application {
Expand All @@ -56,7 +56,6 @@ export interface IPlugin<T, U> {
requires?: Token<any>[];
}


// (No @packageDocumentation comment for this package)

```
53 changes: 11 additions & 42 deletions review/api/collections.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,21 @@ import { IIterator } from '@lumino/algorithm';
import { IRetroable } from '@lumino/algorithm';
import { IterableOrArrayLike } from '@lumino/algorithm';

// @public
export class BPlusTree<T> implements IIterable<T>, IRetroable<T> {
constructor(cmp: (a: T, b: T) => number);
assign(items: IterableOrArrayLike<T>): void;
at(index: number): T | undefined;
clear(): void;
readonly cmp: (a: T, b: T) => number;
delete<U>(key: U, cmp: (item: T, key: U) => number): T | undefined;
readonly first: T | undefined;
get<U>(key: U, cmp: (item: T, key: U) => number): T | undefined;
has<U>(key: U, cmp: (item: T, key: U) => number): boolean;
indexOf<U>(key: U, cmp: (item: T, key: U) => number): number;
insert(item: T): T | undefined;
readonly isEmpty: boolean;
iter(): IIterator<T>;
readonly last: T | undefined;
remove(index: number): T | undefined;
retro(): IIterator<T>;
retroSlice(start?: number, stop?: number): IIterator<T>;
readonly size: number;
slice(start?: number, stop?: number): IIterator<T>;
update(items: IterableOrArrayLike<T>): void;
}

// @public
export namespace BPlusTree {
export function from<T>(items: IterableOrArrayLike<T>, cmp: (a: T, b: T) => number): BPlusTree<T>;
}

// @public
export class LinkedList<T> implements IIterable<T>, IRetroable<T> {
constructor();
addFirst(value: T): LinkedList.INode<T>;
addLast(value: T): LinkedList.INode<T>;
assign(values: IterableOrArrayLike<T>): void;
clear(): void;
readonly first: T | undefined;
readonly firstNode: LinkedList.INode<T> | null;
get first(): T | undefined;
get firstNode(): LinkedList.INode<T> | null;
insertAfter(value: T, ref: LinkedList.INode<T> | null): LinkedList.INode<T>;
insertBefore(value: T, ref: LinkedList.INode<T> | null): LinkedList.INode<T>;
readonly isEmpty: boolean;
get isEmpty(): boolean;
iter(): IIterator<T>;
readonly last: T | undefined;
readonly lastNode: LinkedList.INode<T> | null;
readonly length: number;
get last(): T | undefined;
get lastNode(): LinkedList.INode<T> | null;
get length(): number;
nodes(): IIterator<LinkedList.INode<T>>;
pop(): T | undefined;
push(value: T): void;
Expand All @@ -63,7 +33,7 @@ export class LinkedList<T> implements IIterable<T>, IRetroable<T> {
retro(): IIterator<T>;
retroNodes(): IIterator<LinkedList.INode<T>>;
shift(value: T): void;
readonly size: number;
get size(): number;
unshift(): T | undefined;
}

Expand All @@ -74,13 +44,13 @@ export namespace LinkedList {
clone(): IIterator<INode<T>>;
iter(): IIterator<INode<T>>;
next(): INode<T> | undefined;
}
}
export class ForwardValueIterator<T> implements IIterator<T> {
constructor(node: INode<T> | null);
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
}
}
export function from<T>(values: IterableOrArrayLike<T>): LinkedList<T>;
export interface INode<T> {
readonly list: LinkedList<T> | null;
Expand All @@ -93,16 +63,15 @@ export namespace LinkedList {
clone(): IIterator<INode<T>>;
iter(): IIterator<INode<T>>;
next(): INode<T> | undefined;
}
}
export class RetroValueIterator<T> implements IIterator<T> {
constructor(node: INode<T> | null);
clone(): IIterator<T>;
iter(): IIterator<T>;
next(): T | undefined;
}
}
}


// (No @packageDocumentation comment for this package)

```
58 changes: 32 additions & 26 deletions review/api/commands.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,70 +7,76 @@
import { IDisposable } from '@lumino/disposable';
import { ISignal } from '@lumino/signaling';
import { ReadonlyJSONObject } from '@lumino/coreutils';
import { ReadonlyPartialJSONObject } from '@lumino/coreutils';
import { VirtualElement } from '@lumino/virtualdom';

// @public
export class CommandRegistry {
constructor();
addCommand(id: string, options: CommandRegistry.ICommandOptions): IDisposable;
addKeyBinding(options: CommandRegistry.IKeyBindingOptions): IDisposable;
caption(id: string, args?: ReadonlyJSONObject): string;
className(id: string, args?: ReadonlyJSONObject): string;
readonly commandChanged: ISignal<this, CommandRegistry.ICommandChangedArgs>;
readonly commandExecuted: ISignal<this, CommandRegistry.ICommandExecutedArgs>;
dataset(id: string, args?: ReadonlyJSONObject): CommandRegistry.Dataset;
execute(id: string, args?: ReadonlyJSONObject): Promise<any>;
caption(id: string, args?: ReadonlyPartialJSONObject): string;
className(id: string, args?: ReadonlyPartialJSONObject): string;
get commandChanged(): ISignal<this, CommandRegistry.ICommandChangedArgs>;
get commandExecuted(): ISignal<this, CommandRegistry.ICommandExecutedArgs>;
dataset(id: string, args?: ReadonlyPartialJSONObject): CommandRegistry.Dataset;
describedBy(id: string, args?: ReadonlyPartialJSONObject): Promise<CommandRegistry.Description>;
execute(id: string, args?: ReadonlyPartialJSONObject): Promise<any>;
hasCommand(id: string): boolean;
// @deprecated (undocumented)
icon(id: string, args?: ReadonlyJSONObject): string;
iconClass(id: string, args?: ReadonlyJSONObject): string;
iconLabel(id: string, args?: ReadonlyJSONObject): string;
isEnabled(id: string, args?: ReadonlyJSONObject): boolean;
isToggled(id: string, args?: ReadonlyJSONObject): boolean;
isVisible(id: string, args?: ReadonlyJSONObject): boolean;
readonly keyBindingChanged: ISignal<this, CommandRegistry.IKeyBindingChangedArgs>;
readonly keyBindings: ReadonlyArray<CommandRegistry.IKeyBinding>;
label(id: string, args?: ReadonlyJSONObject): string;
icon(id: string, args?: ReadonlyPartialJSONObject): VirtualElement.IRenderer | undefined;
iconClass(id: string, args?: ReadonlyPartialJSONObject): string;
iconLabel(id: string, args?: ReadonlyPartialJSONObject): string;
isEnabled(id: string, args?: ReadonlyPartialJSONObject): boolean;
isToggleable(id: string, args?: ReadonlyJSONObject): boolean;
isToggled(id: string, args?: ReadonlyPartialJSONObject): boolean;
isVisible(id: string, args?: ReadonlyPartialJSONObject): boolean;
get keyBindingChanged(): ISignal<this, CommandRegistry.IKeyBindingChangedArgs>;
get keyBindings(): ReadonlyArray<CommandRegistry.IKeyBinding>;
label(id: string, args?: ReadonlyPartialJSONObject): string;
listCommands(): string[];
mnemonic(id: string, args?: ReadonlyJSONObject): number;
mnemonic(id: string, args?: ReadonlyPartialJSONObject): number;
notifyCommandChanged(id?: string): void;
processKeydownEvent(event: KeyboardEvent): void;
usage(id: string, args?: ReadonlyJSONObject): string;
usage(id: string, args?: ReadonlyPartialJSONObject): string;
}

// @public
export namespace CommandRegistry {
export type CommandFunc<T> = (args: ReadonlyJSONObject) => T;
export type CommandFunc<T> = (args: ReadonlyPartialJSONObject) => T;
export type Dataset = {
readonly [key: string]: string;
};
export type Description = {
args: ReadonlyJSONObject | null;
};
export function formatKeystroke(keystroke: string): string;
export interface ICommandChangedArgs {
readonly id: string | undefined;
readonly type: 'added' | 'removed' | 'changed' | 'many-changed';
}
export interface ICommandExecutedArgs {
readonly args: ReadonlyJSONObject;
readonly args: ReadonlyPartialJSONObject;
readonly id: string;
readonly result: Promise<any>;
}
export interface ICommandOptions {
caption?: string | CommandFunc<string>;
className?: string | CommandFunc<string>;
dataset?: Dataset | CommandFunc<Dataset>;
describedBy?: Partial<Description> | CommandFunc<Partial<Description> | Promise<Partial<Description>>>;
execute: CommandFunc<any | Promise<any>>;
// @deprecated (undocumented)
icon?: string | CommandFunc<string>;
icon?: VirtualElement.IRenderer | undefined | CommandFunc<VirtualElement.IRenderer | undefined>;
iconClass?: string | CommandFunc<string>;
iconLabel?: string | CommandFunc<string>;
isEnabled?: CommandFunc<boolean>;
isToggleable?: boolean;
isToggled?: CommandFunc<boolean>;
isVisible?: CommandFunc<boolean>;
label?: string | CommandFunc<string>;
mnemonic?: number | CommandFunc<number>;
usage?: string | CommandFunc<string>;
}
export interface IKeyBinding {
readonly args: ReadonlyJSONObject;
readonly args: ReadonlyPartialJSONObject;
readonly command: string;
readonly keys: ReadonlyArray<string>;
readonly selector: string;
Expand All @@ -80,7 +86,7 @@ export namespace CommandRegistry {
readonly type: 'added' | 'removed';
}
export interface IKeyBindingOptions {
args?: ReadonlyJSONObject;
args?: ReadonlyPartialJSONObject;
command: string;
keys: string[];
linuxKeys?: string[];
Expand All @@ -95,13 +101,13 @@ export namespace CommandRegistry {
key: string;
shift: boolean;
}
export function isModifierKeyPressed(event: KeyboardEvent): boolean;
export function keystrokeForKeydownEvent(event: KeyboardEvent): string;
export function normalizeKeys(options: IKeyBindingOptions): string[];
export function normalizeKeystroke(keystroke: string): string;
export function parseKeystroke(keystroke: string): IKeystrokeParts;
}


// (No @packageDocumentation comment for this package)

```
Loading

0 comments on commit ea51ff3

Please sign in to comment.