diff --git a/notNeededPackages.json b/notNeededPackages.json index 4fb2ecedb3..e23ab44082 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1008,12 +1008,6 @@ "sourceRepoURL": "https://github.com/blakeembrey/param-case", "asOfVersion": "1.1.2" }, - { - "libraryName": "parse5", - "typingsPackageName": "parse5", - "sourceRepoURL": "https://github.com/inikulin/parse5", - "asOfVersion": "3.0.0" - }, { "libraryName": "pascal-case", "typingsPackageName": "pascal-case", diff --git a/types/axios-token-interceptor/package.json b/types/axios-token-interceptor/package.json index bd5a40b16d..4f244abbfd 100644 --- a/types/axios-token-interceptor/package.json +++ b/types/axios-token-interceptor/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "axios": "^0.16.2" + "axios": "*" } } diff --git a/types/backbone.marionette/backbone.marionette-tests.ts b/types/backbone.marionette/backbone.marionette-tests.ts index f57e9e2edc..c6400b2672 100644 --- a/types/backbone.marionette/backbone.marionette-tests.ts +++ b/types/backbone.marionette/backbone.marionette-tests.ts @@ -1,3 +1,4 @@ +import * as JQuery from 'jquery'; import * as Marionette from 'backbone.marionette'; import * as Backbone from 'backbone'; @@ -9,6 +10,10 @@ class DestroyWarn extends Marionette.Behavior { message: 'you are destroying!' }; + ui = { + destroy: '.foo' + }; + // behaviors have events that are bound to the views DOM events = { 'click @ui.destroy': 'warnBeforeDestroy' @@ -258,12 +263,18 @@ function RegionTests() { }); } +function BehaviorTest() { + const b = new DestroyWarn(); + const uiHandle: JQuery = b.getUI('destroy'); +} + function ViewTests() { const v = new MyView(new MyModel()); const isDestroyed: boolean = v.isDestroyed(); const isRendered: boolean = v.isRendered(); const isAttached: boolean = v.isAttached(); const vv: Marionette.View = v.delegateEntityEvents(); + const uiHandle: JQuery = v.getUI('destroy'); } function CollectionViewTests() { diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index 7626d60d56..0b717c9bb1 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -1143,6 +1143,11 @@ export class View extends Backbone.View i * throughout the view with the ui attribute. */ ui: any; + + /** + * Get handle on UI element defined in ui hash + */ + getUI(ui: string): JQuery; } export interface CollectionViewOptions< @@ -1561,6 +1566,11 @@ export class Behavior extends Object { */ ui: any; + /** + * Get handle on UI element defined in ui hash + */ + getUI(ui: string): JQuery; + /** * Any triggers you define on the Behavior will be triggered in response to the appropriate event on the view. */ diff --git a/types/bleno/bleno-tests.ts b/types/bleno/bleno-tests.ts index bd4b6971ee..7ea037587c 100644 --- a/types/bleno/bleno-tests.ts +++ b/types/bleno/bleno-tests.ts @@ -1,4 +1,7 @@ import * as Bleno from 'bleno'; +// can also import these types as if they were exported from the module +// tslint:disable-next-line:no-duplicate-imports +import { Characteristic, Descriptor, PrimaryService } from 'bleno'; export class EchoCharacteristic extends Bleno.Characteristic { _value: any; @@ -46,7 +49,7 @@ Bleno.on('stateChange', (state: string) => { }); const characteristic = new EchoCharacteristic(); -Bleno.on('advertisingStart', (error: string) => { +Bleno.on('advertisingStart', (error?: Error | null) => { if (!error) { Bleno.setServices( [new Bleno.PrimaryService({uuid: 'ec00', characteristics: [ characteristic ] })], @@ -54,3 +57,266 @@ Bleno.on('advertisingStart', (error: string) => { ); } }); + +const SERVICE_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3863'; +const CONTROL_CHAR_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3864'; +const STATUS_CHAR_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3866'; + +class StatusCharacteristic extends Characteristic { + constructor() { + super({ + uuid: 'STATUS_CHAR_UUID', + properties: ['read'], + descriptors: [ + new Descriptor({ + uuid: '2901', + value: Buffer.from('Status'), + }), + ], + }); + } + + onReadRequest( + offset: number, + callback: (result: number, data?: Buffer) => void + ) { + try { + const data = Buffer.from('status ok'); + callback(Characteristic.RESULT_SUCCESS, data.slice(offset)); + } catch (error) { + callback(Characteristic.RESULT_UNLIKELY_ERROR); + } + } +} + +class ControlCharacteristic extends Characteristic { + private readonly callback: (data: Buffer) => void; + + constructor(onWriteRequestCb: (data: Buffer) => void) { + super({ + uuid: CONTROL_CHAR_UUID, + properties: ['write'], + descriptors: [ + new Descriptor({ + uuid: '2901', + value: Buffer.from('test characteristic'), + }), + ], + }); + this.callback = onWriteRequestCb; + } + + onWriteRequest( + data: Buffer, + offset: number, + withoutResponse: any, + callback: (result: number) => void + ): void { + if (offset > 0) { + this.callback(data.slice(offset)); + } else { + this.callback(data); + } + callback(this.RESULT_SUCCESS); + } +} + +export class BluetoothController { + private isAdvertising: boolean; + + constructor() { + this.isAdvertising = false; + this.setup(); + } + + toString(): string { + return ''; + } + + dispose(callback: () => void) { + if (this.isAdvertising) { + Bleno.stopAdvertising(callback); + } else { + callback(); + } + } + + private setup() { + Bleno.on('stateChange', (state: string) => { + console.log('bluetooth', `stateChange: ${state}, address = ${Bleno.address}`); + + if (state === 'poweredOn') { + Bleno.startAdvertising('device', [SERVICE_UUID]); + } else { + Bleno.stopAdvertising(); + } + }); + + Bleno.on('accept', (clientAddress: string) => { + console.log('bluetooth', `accept, client: ${clientAddress}`); + Bleno.updateRssi(); + }); + + Bleno.on('disconnect', (clientAddress: string) => { + console.log('bluetooth', `disconnect, client: ${clientAddress}`); + }); + + Bleno.on('rssiUpdate', (rssi: number) => { + console.log('bluetooth', `rssiUpdate: ${rssi}`); + }); + + Bleno.on('mtuChange', (mtu: number) => { + console.log('bluetooth', `mtuChange: ${mtu}`); + }); + + Bleno.on('advertisingStart', (error?: Error | null) => { + console.log('bluetooth', `advertisingStart: ${error ? error : 'success'}`); + if (!error) { + this.isAdvertising = true; + Bleno.setServices([ + new PrimaryService({ + uuid: SERVICE_UUID, + characteristics: [ + new ControlCharacteristic((data) => { + this.onWriteRequest(data); + }), + new StatusCharacteristic(), + ], + }), + ]); + } + }); + + Bleno.on('advertisingStop', () => { + this.isAdvertising = false; + console.log('bluetooth', 'advertisingStop'); + }); + + Bleno.on('servicesSet', (error?: Error | null) => { + console.log('bluetooth', `servicesSet: ${error ? error : 'success'}`); + }); + } + + private onWriteRequest(data: Buffer) { + console.log(data.toString('hex')); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// code from bleno's README +// + +// tslint:disable-next-line:no-duplicate-imports +import * as bleno from 'bleno'; + +function test1() { + const name = 'name'; + const serviceUuids = ['fffffffffffffffffffffffffffffff0']; + + bleno.startAdvertising(name); + bleno.startAdvertising(name, serviceUuids); + bleno.startAdvertising(name, serviceUuids, (error) => {}); +} + +function test2() { + const uuid = 'e2c56db5dffb48d2b060d0f5a71096e0'; + const major = 0; // 0x0000 - 0xffff + const minor = 0; // 0x0000 - 0xffff + const measuredPower = -59; // -128 - 127 + + bleno.startAdvertisingIBeacon(uuid, major, minor, measuredPower); + bleno.startAdvertisingIBeacon(uuid, major, minor, measuredPower, (error) => {}); +} + +function test3() { + const scanData = new Buffer(''); // maximum 31 bytes + const advertisementData = new Buffer(''); // maximum 31 bytes + + bleno.startAdvertisingWithEIRData(advertisementData); + bleno.startAdvertisingWithEIRData(advertisementData, (error) => {}); + bleno.startAdvertisingWithEIRData(advertisementData, scanData, (error) => {}); +} + +function test4() { + bleno.stopAdvertising(); + bleno.stopAdvertising(() => {}); +} + +function test5() { + const service = new PrimaryService({uuid: '0000'}); + const services = [ + service + ]; + + bleno.setServices(services); + bleno.setServices(services, (error) => {}); +} + +function test6() { + bleno.disconnect(); // Linux only +} + +function test7() { + bleno.updateRssi(); // not available in OS X 10.9 + bleno.updateRssi((error, rssi) => {}); // not available in OS X 10.9 +} + +function test8() { + const PrimaryService = bleno.PrimaryService; + + const primaryService = new PrimaryService({ + uuid: 'fffffffffffffffffffffffffffffff0', // or 'fff0' for 16-bit + characteristics: [ + // see Characteristic for data type + ] + }); +} + +function test9() { + const Characteristic = bleno.Characteristic; + + const characteristic = new Characteristic({ + uuid: 'fffffffffffffffffffffffffffffff1', // or 'fff1' for 16-bit + properties: ['read'], // can be a combination of 'read', 'write', 'writeWithoutResponse', 'notify', 'indicate' + secure: ['notify'], // enable security for properties, can be a combination of 'read', 'write', 'writeWithoutResponse', 'notify', 'indicate' + value: null, // optional static value, must be of type Buffer - for read only characteristics + descriptors: [ + // see Descriptor for data type + new Descriptor({uuid: '0000'}) + ], + onReadRequest: null, // optional read request handler, function(offset, callback) { ... } + onWriteRequest: null, // optional write request handler, function(data, offset, withoutResponse, callback) { ...} + onSubscribe: null, // optional notify/indicate subscribe handler, function(maxValueSize, updateValueCallback) { ...} + onUnsubscribe: null, // optional notify/indicate unsubscribe handler, function() { ...} + onNotify: null, // optional notify sent handler, function() { ...} + onIndicate: null // optional indicate confirmation received handler, function() { ...} + }); +} + +function test10() { + Characteristic.RESULT_SUCCESS; + Characteristic.RESULT_INVALID_OFFSET; + Characteristic.RESULT_INVALID_ATTRIBUTE_LENGTH; + Characteristic.RESULT_UNLIKELY_ERROR; +} + +function test11() { + const Descriptor = bleno.Descriptor; + + const descriptor = new Descriptor({ + uuid: '2901', + value: 'value' // static value, must be of type Buffer or string if set + }); +} + +function test12() { + bleno.on('stateChange', (state: string) => {}); + bleno.on('advertisingStart', (error?: Error | null) => {}); + bleno.on('advertisingStartError', (error: Error) => {}); + bleno.on('advertisingStop', () => {}); + bleno.on('servicesSet', (error?: Error | null) => {}); + bleno.on('servicesSetError', (error: Error) => {}); + bleno.on('accept', (clientAddress) => {}); // not available on OS X 10.9 + bleno.on('disconnect', (clientAddress) => {}); // Linux only + bleno.on('rssiUpdate', (rssi) => {}); // not available on OS X 10.9 +} diff --git a/types/bleno/index.d.ts b/types/bleno/index.d.ts index a59e394a84..0dee37c9ed 100644 --- a/types/bleno/index.d.ts +++ b/types/bleno/index.d.ts @@ -3,126 +3,147 @@ // Definitions by: Manuel Francisco Naranjo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export class Characteristic { - uuid: any; - properties: any; - secure: any; - value: any; - descriptors: any; +/// - constructor(options: any); +type State = 'poweredOn' | 'poweredOff' | 'unauthorized' | 'unsupported' | 'unknown' | 'resetting'; + +type Property = 'read' | 'write' | 'indicate' | 'notify' | 'writeWithoutResponse'; + +interface CharacteristicOptions { + uuid: string; + properties?: ReadonlyArray | null; + secure?: ReadonlyArray | null; + value?: Buffer | null; + descriptors?: ReadonlyArray | null; + onIndicate?: (() => void) | null; + onNotify?: (() => void) | null; + onReadRequest?: (( + offset: number, + callback: (result: number, data?: Buffer) => void + ) => void) | null; + onSubscribe?: ((maxValueSize: number, updateValueCallback: any) => void) | null; + onUnsubscribe?: (() => void) | null; + onWriteRequest?: (( + data: Buffer, + offset: number, + withoutResponse: boolean, + callback: (result: number) => void + ) => void) | null; +} + +declare class Characteristic { + uuid: string; + properties: ReadonlyArray; + secure: ReadonlyArray; + value: Buffer | null; + descriptors: ReadonlyArray; + + constructor(options: CharacteristicOptions); onIndicate(): void; onNotify(): void; - onReadRequest(offset: any, callback: any): void; + onReadRequest(offset: number, callback: (result: number, data?: Buffer) => void): void; - onSubscribe(maxValueSize: any, updateValueCallback: any): void; + onSubscribe(maxValueSize: number, updateValueCallback: any): void; onUnsubscribe(): void; - onWriteRequest(data: any, offset: any, withoutResponse: any, callback: any): void; + onWriteRequest(data: Buffer, offset: number, withoutResponse: boolean, callback: (result: number) => void): void; - toString(): any; + toString(): string; - static RESULT_ATTR_NOT_LONG: number; + readonly RESULT_ATTR_NOT_LONG: number; - static RESULT_INVALID_ATTRIBUTE_LENGTH: number; + readonly RESULT_INVALID_ATTRIBUTE_LENGTH: number; - static RESULT_INVALID_OFFSET: number; + readonly RESULT_INVALID_OFFSET: number; - static RESULT_SUCCESS: number; + readonly RESULT_SUCCESS: number; - static RESULT_UNLIKELY_ERROR: number; + readonly RESULT_UNLIKELY_ERROR: number; + + static readonly RESULT_ATTR_NOT_LONG: number; + + static readonly RESULT_INVALID_ATTRIBUTE_LENGTH: number; + + static readonly RESULT_INVALID_OFFSET: number; + + static readonly RESULT_SUCCESS: number; + + static readonly RESULT_UNLIKELY_ERROR: number; } -export class Descriptor { - uuid: any; - value: any; - - constructor(options: any); - - toString(): any; +interface DescriptorOptions { + uuid: string; + value?: Buffer | string | null; } -export class PrimaryService { - uuid: any; - characteristics: any; +declare class Descriptor { + uuid: string; + value: Buffer; - constructor(options: any); + constructor(options: DescriptorOptions); - toString(): any; + toString(): string; } -export const address: string; +interface PrimaryServiceOptions { + uuid: string; + characteristics?: ReadonlyArray | null; +} -export const domain: any; +declare class PrimaryService { + uuid: string; + characteristics: ReadonlyArray; -export const mtu: number; + constructor(options: PrimaryServiceOptions); -export const platform: string; + toString(): string; +} -export const rssi: number; +interface Bleno extends NodeJS.EventEmitter { + readonly Characteristic: typeof Characteristic; + readonly Descriptor: typeof Descriptor; + readonly PrimaryService: typeof PrimaryService; -export const state: string; + readonly address: string; -export function addListener(type: any, listener: any): any; + readonly mtu: number; -export function disconnect(): void; + readonly platform: string; -export function emit(type: any, ...args: any[]): any; + readonly rssi: number; -export function eventNames(): any; + readonly state: State; -export function getMaxListeners(): any; + disconnect(): void; -export function listenerCount(type: any): any; + setServices(services: ReadonlyArray, callback?: (arg: Error | undefined | null) => void): void; -export function listeners(type: any): any; + startAdvertising(name: string, serviceUuids?: ReadonlyArray, callback?: (arg: Error | undefined | null) => void): void; -export function on(type: any, listener: any): any; + startAdvertisingIBeacon(uuid: string, major: number, minor: number, measuredPower: number, callback?: (arg: Error | undefined | null) => void): void; -export function onAccept(clientAddress: any): void; + startAdvertisingWithEIRData(advertisementData: Buffer, callback?: (arg: Error | undefined | null) => void): void; + startAdvertisingWithEIRData(advertisementData: Buffer, scanData: Buffer, callback?: (arg: Error | undefined | null) => void): void; -export function onAddressChange(address: any): void; + stopAdvertising(callback?: () => void): void; -export function onAdvertisingStart(error: any): void; + updateRssi(callback?: (err: null, rssi: number) => void): void; -export function onAdvertisingStop(): void; + on(event: 'stateChange', cb: (state: State) => void): this; + on(event: 'accept', cb: (address: string) => void): this; + on(event: 'mtuChange', cb: (mtu: number) => void): this; + on(event: 'disconnect', cb: (clientAddress: string) => void): this; + on(event: 'advertisingStart', cb: (err?: Error | null) => void): this; + on(event: 'advertisingStartError', cb: (err: Error) => void): this; + on(event: 'advertisingStop', cb: () => void): this; + on(event: 'servicesSet', cb: (err?: Error | null) => void): this; + on(event: 'servicesSetError', cb: (err: Error) => void): this; + on(event: 'rssiUpdate', cb: (rssi: number) => void): this; +} -export function onDisconnect(clientAddress: any): void; - -export function onMtuChange(mtu: any): void; - -export function onPlatform(platform: any): void; - -export function onRssiUpdate(rssi: any): void; - -export function onServicesSet(error: any): void; - -export function onStateChange(state: any): void; - -export function once(type: any, listener: any): any; - -export function prependListener(type: any, listener: any): any; - -export function prependOnceListener(type: any, listener: any): any; - -export function removeAllListeners(type: any, ...args: any[]): any; - -export function removeListener(type: any, listener: any): any; - -export function setMaxListeners(n: any): any; - -export function setServices(services: any, callback: any): void; - -export function startAdvertising(name: any, serviceUuids: any, callback: any): void; - -export function startAdvertisingIBeacon(uuid: any, major: any, minor: any, measuredPower: any, callback: any): void; - -export function startAdvertisingWithEIRData(advertisementData: any, scanData: any, callback: any): void; - -export function stopAdvertising(callback: any): void; - -export function updateRssi(callback: any): void; +declare const bleno: Bleno; +export = bleno; diff --git a/types/bleno/tslint.json b/types/bleno/tslint.json index 26bcea6634..0f5eeaf557 100644 --- a/types/bleno/tslint.json +++ b/types/bleno/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "dt-header": false + "dt-header": false, + "unified-signatures": false } } diff --git a/types/ember-resolver/ember-resolver-tests.ts b/types/ember-resolver/ember-resolver-tests.ts new file mode 100644 index 0000000000..d22a0d31be --- /dev/null +++ b/types/ember-resolver/ember-resolver-tests.ts @@ -0,0 +1,12 @@ +import Application from '@ember/application'; +import EmberResolver from 'ember-resolver'; + +const MyResolver = EmberResolver.extend({ + pluralizedTypes: { + sheep: 'sheep' + } +}); + +const App = Application.extend({ + Resolver: MyResolver +}); diff --git a/types/ember-resolver/index.d.ts b/types/ember-resolver/index.d.ts new file mode 100644 index 0000000000..7c9ac5b6d0 --- /dev/null +++ b/types/ember-resolver/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for ember-resolver 4.5 +// Project: https://github.com/ember-cli/ember-resolver#readme +// Definitions by: Dan Freeman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import Resolver from '@ember/application/resolver'; + +/** + * An Ember `Resolver` implementation used by ember-cli. + */ +export default class EmberResolver extends Resolver {} diff --git a/types/ember-resolver/tsconfig.json b/types/ember-resolver/tsconfig.json new file mode 100644 index 0000000000..981bd60243 --- /dev/null +++ b/types/ember-resolver/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember-resolver-tests.ts" + ] +} diff --git a/types/ember-resolver/tslint.json b/types/ember-resolver/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ember-resolver/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-session/express-session-tests.ts b/types/express-session/express-session-tests.ts index dc57e88f0d..9189db1dfb 100644 --- a/types/express-session/express-session-tests.ts +++ b/types/express-session/express-session-tests.ts @@ -11,7 +11,7 @@ app.use(session({ secret: 'keyboard cat', name: 'connect.sid', store: new session.MemoryStore(), - cookie: { path: '/', httpOnly: true, secure: false }, + cookie: { path: '/', httpOnly: true, secure: false, sameSite: true }, genid: (req: express.Request): string => '', rolling: false, resave: true, diff --git a/types/express-session/index.d.ts b/types/express-session/index.d.ts index 29d2b4fbbc..fdceafeeea 100644 --- a/types/express-session/index.d.ts +++ b/types/express-session/index.d.ts @@ -32,6 +32,7 @@ declare global { httpOnly: boolean; domain?: string; expires: Date | boolean; + sameSite?: boolean | string; } interface SessionCookie extends SessionCookieData { diff --git a/types/git-branch/git-branch-tests.ts b/types/git-branch/git-branch-tests.ts new file mode 100644 index 0000000000..4b02cb5da3 --- /dev/null +++ b/types/git-branch/git-branch-tests.ts @@ -0,0 +1,14 @@ +import gitBranch = require('git-branch'); + +gitBranch() + .then((name) => {}); + +gitBranch('cwd') + .then((name) => {}); + +gitBranch.sync(); +gitBranch.sync('cwd'); + +gitBranch((err, name) => {}); + +gitBranch('cwd', (err, name) => {}); diff --git a/types/git-branch/index.d.ts b/types/git-branch/index.d.ts new file mode 100644 index 0000000000..a1cecc9691 --- /dev/null +++ b/types/git-branch/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for git-branch 2.0 +// Project: https://github.com/jonschlinkert/git-branch +// Definitions by: Ryan Clark +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export = GitBranch; + +declare function GitBranch(cwd?: string): Promise; +declare function GitBranch(cwd?: string, callback?: (err: null | string, name: string) => void): void; +declare function GitBranch(callback?: (err: null | string, name: string) => void): void; + +declare namespace GitBranch { + function sync(cwd?: string): string; +} diff --git a/types/git-branch/tsconfig.json b/types/git-branch/tsconfig.json new file mode 100644 index 0000000000..0ed27223a0 --- /dev/null +++ b/types/git-branch/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "git-branch-tests.ts" + ] +} diff --git a/types/git-branch/tslint.json b/types/git-branch/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-branch/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jsdom/index.d.ts b/types/jsdom/index.d.ts index cfb54fa25f..5ccdd33a65 100644 --- a/types/jsdom/index.d.ts +++ b/types/jsdom/index.d.ts @@ -7,7 +7,7 @@ /// import { EventEmitter } from 'events'; -import { MarkupData } from 'parse5'; +import { ElementLocation } from 'parse5'; import * as tough from 'tough-cookie'; import { Script } from 'vm'; @@ -32,7 +32,7 @@ export class JSDOM { /** * The nodeLocation() method will find where a DOM node is within the source document, returning the parse5 location info for the node. */ - nodeLocation(node: Node): MarkupData.ElementLocation | null; + nodeLocation(node: Node): ElementLocation | null; /** * The built-in vm module of Node.js allows you to create Script instances, diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index 7d759eb974..dc9f7d43f0 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -4311,7 +4311,7 @@ declare namespace kendo.ui { scrollable?: boolean | GridScrollable; selectable?: boolean|string; sortable?: boolean | GridSortable; - toolbar?: GridToolbarItem[]; + toolbar?: string|Function|(string|GridToolbarItem)[]; beforeEdit?(e: GridBeforeEditEvent): void; cancel?(e: GridCancelEvent): void; cellClose?(e: GridCellCloseEvent): void; diff --git a/types/koa-static-cache/index.d.ts b/types/koa-static-cache/index.d.ts new file mode 100644 index 0000000000..ba5ed2d0e9 --- /dev/null +++ b/types/koa-static-cache/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for koa-static-cache 5.1 +// Project: https://github.com/koajs/static-cache#readme +// Definitions by: JounQin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/** + * Static server for koa. + */ + +import { Middleware } from 'koa'; + +declare namespace staticCache { + interface Files { + [path: string]: Options; + } + + interface Options { + dir?: string; + maxAge?: number; + cacheControl?: string; + buffer?: boolean; + gzip?: boolean; + usePrecompiledGzip?: boolean; + alias?: {}; + prefix?: string; + dynamic?: boolean; + filter?: ((path: string) => boolean) | string[]; + preload?: boolean; + files?: Files; + } +} + +declare function staticCache( + dir: string | staticCache.Options, + options?: staticCache.Options | staticCache.Files, + files?: staticCache.Files +): Middleware; + +export = staticCache; diff --git a/types/koa-static-cache/koa-static-cache-tests.ts b/types/koa-static-cache/koa-static-cache-tests.ts new file mode 100644 index 0000000000..1906c0bc25 --- /dev/null +++ b/types/koa-static-cache/koa-static-cache-tests.ts @@ -0,0 +1,46 @@ +import Koa = require('koa'); +import staticCache = require('koa-static-cache'); + +const app = new Koa(); + +app.use(staticCache('.')); + +app.use( + staticCache('.', { + maxAge: 0, + filter: [''] + }) +); + +const files: staticCache.Files = {}; + +app.use( + staticCache( + '.', + { + maxAge: 0, + filter: path => !!path + }, + files + ) +); + +files['/service-worker.js'].maxAge = 0; + +app.use( + staticCache({ + dir: '.', + maxAge: 0, + files + }) +); + +app.use( + staticCache( + { + dir: '.', + maxAge: 0 + }, + files + ) +); diff --git a/types/koa-static-cache/tsconfig.json b/types/koa-static-cache/tsconfig.json new file mode 100644 index 0000000000..61082ed384 --- /dev/null +++ b/types/koa-static-cache/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-static-cache-tests.ts" + ] +} diff --git a/types/koa-static-cache/tslint.json b/types/koa-static-cache/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-static-cache/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/lru-cache/index.d.ts b/types/lru-cache/index.d.ts index 5a6c9c9e4f..ed40619b11 100644 --- a/types/lru-cache/index.d.ts +++ b/types/lru-cache/index.d.ts @@ -40,7 +40,7 @@ declare namespace LRU { * `max` like-sized things. The item is passed as the first argument, * and the key is passed as the second argument. */ - length?(value: V): number; + length?(value: V, key?: K): number; /** * Function that is called on items when they are dropped from the cache. diff --git a/types/motor-hat/index.d.ts b/types/motor-hat/index.d.ts new file mode 100644 index 0000000000..7e3de98395 --- /dev/null +++ b/types/motor-hat/index.d.ts @@ -0,0 +1,553 @@ +// Type definitions for motor-hat 2.0 +// Project: http://www.github.com/jcane86/motor-hat +// Definitions by: Yevgen Muntyan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export type Direction = 'fwd' | 'back'; + +type Callback = (err?: Error, result?: any) => void; + +export interface PinDefinitionObject { + /** + * Pin number of the PWM output + */ + PWM: number; + + /** + * Pin number of the first coil output + */ + IN1: number; + + /** + * Pin number of the second coil output + */ + IN2: number; +} + +export type PinDefinition = PinDefinitionObject | number[]; + +export interface DCOptions { + /** + * PWM Interface Object + */ + pwm: object; + + /** + * Pin definition for the motor + */ + pins: PinDefinition; + + speed?: number; + frequency?: number; +} + +/** + * DC Controller Object + */ +export interface DC { + /** + * Initialize the DC controller instance. + * Synchronous overload. + */ + init(): this; + + /** + * Initialize the DC controller instance. + * Asynchronous overload. + * + * @param cb Node style callback for asynch initialization + */ + init(cb: Callback): void; + + /** + * Starts the motor in the desired direction. + * + * @param dir Direction of movement. + * @param cb Node style callback. Gets called with cb(err, result) after completion. + */ + run(dir: Direction, cb: Callback): void; + + /** + * Starts the motor in the desired direction. + * + * @param dir Direction of movement. + */ + runSync(dir: Direction): void; + + /** + * Stops the motor. + * Doesn't actually brake the motor, just stops applying voltage to it. + * + * @param cb Node style callback. Gets called with cb(err, result) after completion. + */ + stop(cb: Callback): void; + + /** + * Stops the motor. + * Doesn't actually brake the motor, just stops applying voltage to it. + */ + stopSync(): void; + + /** + * Sets DC motor speed. + * The speed can be set as a percentage, from 0% to 100%. To change the actual top speed, + * the actual voltage supplied to the motor needs to be controlled by hardware (get a higher + * voltage source). + * + * @param speed Relative speed. 0% to 100%. + * @param cb Node style callback. Gets called with cb(err, result) after completion. + */ + setSpeed(speed: number, cb: Callback): void; + + /** + * Sets DC motor speed. + * The speed can be set as a percentage, from 0% to 100%. To change the actual top speed, + * the actual voltage supplied to the motor needs to be controlled by hardware (get a higher + * voltage source). + * + * @param speed Relative speed. 0% to 100%. + */ + setSpeedSync(speed: number): void; + + /** + * Sets the PWM frequency for the DC motor. + * This setting affects the frequency at which the PWM chip will work to command the DC motor. + * + * @param freq PWM Frequency in Hz. + * @param cb Node style callback. Gets called with cb(err, result) after completion. + */ + setFrequency(freq: number, cb: Callback): void; + + /** + * Sets the PWM frequency for the DC motor. + * This setting affects the frequency at which the PWM chip will work to command the DC motor. + * + * @param freq PWM Frequency in Hz. + */ + setFrequencySync(freq: number): void; +} + +/** + * Servo controller initialization options + */ +export interface ServoOptions { + /** + * PWM Interface Object + */ + pwm: object; + + /** + * Servo controller pin. Which pin (0 to 15) is the servo connected to? + */ + pin: number; + + /** + * Duration in ms of pulse at position 0 + */ + min?: number; + + /** + * Duration in ms of pulse at position 100 + */ + max?: number; + + /** + * PWM Controller frequency for the servo + */ + freq?: number; +} + +/** + * Servo Controller Object + */ +export interface Servo { + /** + * Move Servo to desired position. + * + * @param pos Relative position (0% to 100%). + */ + moveTo(pos: number): void; + + /** + * Calibrate the limits for the servolib + * + * @param freq The update freq in Hz + * @param min The min. pulse in ms + * @param max The max. pulse in ms + */ + calibrate(freq: number, min: number, max: number): void; +} + +/** + * Stepper controller initialization options + */ +export interface StepperOptions { + /** + * PWM Interface Object + */ + pwm: object; + + /** + * Pin definition for the motor + */ + pins: { + /** + * Pin definition for winding 1 of the stepper + */ + W1: PinDefinition; + + /** + * Pin definition for winding 2 of the stepper + */ + W2: PinDefinition; + }; + + /** + * Steps per revolution of the stepper motor + */ + steps?: number; + + /** + * number of microsteps per step + */ + microsteps?: 8 | 16; + + /** + * PWM Controller frequency for the stepper + */ + frequency?: number; + + /** + * Stepping style + */ + style?: 'single' | 'double' | 'interleaved' | 'microstep'; + + current?: number; + + /** + * Pulses per second + */ + pps?: number; + + /** + * Revolutions per minute + */ + rpm?: number; + + /** + * Steps per second + */ + sps?: number; +} + +export interface StepResult { + /** + * Performed steps + */ + steps: number; + + /** + * Direction of steps performed + */ + dir: Direction; + + /** + * Time in ms taken to perform the steps + */ + duration: number; + + /** + * Number of steps retried + */ + retried: number; +} + +export interface StepSyncResult { + /** + * Performed steps + */ + steps: number; + + /** + * Direction of steps performed + */ + dir: Direction; + + /** + * Time in ms taken to perform the steps + */ + duration: number; +} + +/** + * Stepper motor speed for step(). + */ +export interface StepperSpeed { + /** + * Speed in steps per second + */ + sps?: number; + + /** + * Speed in pulses per second (pulses can be steps, microsteps, etc) + */ + pps?: number; + + /** + * Speed in revolutions per minute + */ + rpm?: number; +} + +/** + * Stepper motor controller + */ +export interface Stepper { + readonly options: StepperOptions; + + /** + * Initialize the Stepeper controller instance. + * Synchronous overload. + * + * @returns Returns init'd Stepper controller object (self) + */ + init(): this; + + /** + * Initialize the Stepeper controller instance. + * Synchronous overload. + * + * @param cb Node style callback for asynch initialization + */ + init(cb: (err: null, self: Stepper) => void): void; + + /** + * Perform arbitrary number of steps asynchronously. + * Configuration as stepping style, speed, etc should have been set previously. + * + * @param dir Direction of movement + * @param steps Number of steps. + * @param cb Node style callback. cb(err, result). + */ + step( + dir: Direction, + steps: number, + cb: (err?: Error, result?: StepResult) => void + ): void; + + /** + * Perform arbitrary number of steps synchronously. + * Configuration as stepping style, speed, etc should have been set previously. + * + * @param dir Direction of movement + * @param steps Number of steps. + * @returns The result of the action. + */ + stepSync(dir: Direction, steps: number): StepSyncResult; + + /** + * Perform one step asynchronously. + * Configuration as stepping style, speed, etc should have been set previously. + * + * @param dir Direction of movement + * @param cb Node style callback. cb(err, result). + */ + oneStep(dir: Direction, cb: (err?: Error, result?: any) => void): void; + + /** + * Perform one step synchronously. + * Configuration as stepping style, speed, etc should have been set previously. + * + * @param dir Direction of movement + */ + oneStepSync(dir: Direction): void; + + /** + * Release the stepper motor asynchronously. + * + * Stops applying current to the motor coils. + * + * @param cb Node style callback + */ + release(cb: (err?: Error, result?: any) => void): void; + + /** + * Release the stepper motor synchronously. + * Stops applying current to the motor coils. + */ + releaseSync(): void; + + /** + * Set the current rate at which to supply the steps. + * Provide a number from 0 to 1 and the current will be reduced proportionally + * + * @param current Current rate, from 0 to 1. + */ + setCurrent(current: number): void; + + /** + * Set stepping style. + * + * @param style Stepping style. + */ + setStyle(style: 'single' | 'double' | 'interleaved' | 'microstep'): void; + + /** + * Set PWM Controller working frequency asynchronously. + * + * @param freq PWM frequency. + * @param cb Node style callback. cb(err, result). + */ + setFrequency(freq: number, cb: (err?: Error, result?: any) => void): void; + + /** + * Set PWM Controller working frequency synchronously. + * + * @param freq PWM frequency. + */ + setFrequencySync(freq: number): void; + + /** + * Set desired number of microsteps per step. + * (Used for microstepping) + * + * @param ms Microsteps per step + */ + setMicrosteps(ms: 8 | 16): void; + + /** + * Set number of steps per revolution for motor. + * + * @param steps Number of steps per revolution for stepper motor. + */ + setSteps(steps: number): void; + + /** + * Set motor speed for step(). + */ + setSpeed(speed: StepperSpeed): void; +} + +export interface MotorPins { + readonly PWM: number; + readonly IN2: number; + readonly IN1: number; +} + +/** + * motorHat controller + * + * Needs to be initialized with init(). + */ +export interface MotorHat { + readonly pins: { + M1: MotorPins; + M2: MotorPins; + M3: MotorPins; + M4: MotorPins; + }; + + /** + * Array of initialized Servo controllers + */ + readonly servos: ReadonlyArray; + + /** + * Array of initialized Stepper controllers + */ + readonly steppers: ReadonlyArray; + + /** + * Array of initialized DC controllers + */ + readonly dcs: ReadonlyArray; + + /** + * Creates a servo motor controller. + * Pass in an options object to generate an uninitialized ServoLib object. + */ + servo(opts: ServoOptions): Servo; + + /** + * Creates a stepper motor controller. + * Pass in an options object to generate an uninitialized StepperLib object. + */ + stepper(opts: StepperOptions): Stepper; + + /** + * Creates a new DC motor controller + * Pass in an options object to generate an uninitialized DCLib object + */ + dc(opts: DCOptions): DC; + + /** + * Initialize the motorHat library instance. + * Synchronous overload. + * + * Instantiates the individual Motor/Servo/Stepper controllers and initializes them. + * + * @returns Returns initialized motorHat object (self) + */ + init(): MotorHat; + + /** + * Initialize the motorHat library instance. + * Asynchronous overload. + * + * Instantiates the individual Motor/Servo/Stepper controllers and initializes them. + * Returns initialized motorHat object (self) in second parameter to callback if callback + * provided, to enable chaining. + * + * @param cb Node style callback for asynch initialization + */ + init(cb: Callback): void; +} + +export type Motor = 'M1' | 'M2' | 'M3' | 'M4'; + +export interface MotorHatOptions { + /** + * i2c address of the PWM chip on the MotorHat. + * + * * 0x6F for knockoff HATs. + * + * * 0x60 for official AdaFruit HATs?? + */ + address?: number; + + /** + * i2c driver devfile number. Varies by RaspBerry version. + * Should be automatically detected. + */ + busnum?: number; + + /** + * Definition of the stepper motors connected to the HAT. + * At most 2 steppers, each motor is represented by either an object of the form + * { W1: winding, W2: winding }. Each winding should be one of following: 'M1', 'M2', 'M3', + * 'M4' depending on the port the stepper is connected to. Correct example: { W1: 'M3', W2: 'M1' } + */ + steppers?: ReadonlyArray<{ W1: Motor; W2: Motor }>; + + /** + * Definition of the DC motors connected to the HAT. + * At most 4 DCs, each should be one of following: 'M1', 'M2', 'M3', 'M4' depending on + * port the motor is connected to. + */ + dcs?: ReadonlyArray; + + /** + * Definition of the servos connected to the HAT. + * List of the channels that have servos connected to them. 0 to 15. + */ + servos?: ReadonlyArray; +} + +/** + * Creates a new MotorHat controller + * + * Pass in an options object to generate an uninitialized MotorHat object. + */ +declare function motorhat(options: MotorHatOptions): MotorHat; +export default motorhat; diff --git a/types/motor-hat/motor-hat-tests.ts b/types/motor-hat/motor-hat-tests.ts new file mode 100644 index 0000000000..ee55bfde37 --- /dev/null +++ b/types/motor-hat/motor-hat-tests.ts @@ -0,0 +1,15 @@ +import createMotorHat, { DC, Motor, MotorHat } from 'motor-hat'; + +function test() { + const motors: Motor[] = ['M1', 'M2']; + const motorHat: MotorHat = createMotorHat({ + dcs: motors, + servos: [1, 2, 3], + steppers: [{ W1: 'M3', W2: 'M1' }], + address: 0x60, + }).init(); + const dcL: DC = motorHat.dcs[0]; + const dcR: DC = motorHat.dcs[1]; + dcL.run('fwd', () => {}); + dcR.setSpeed(50, (err) => {}); +} diff --git a/types/motor-hat/tsconfig.json b/types/motor-hat/tsconfig.json new file mode 100644 index 0000000000..61630aed4a --- /dev/null +++ b/types/motor-hat/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "motor-hat-tests.ts" + ] +} diff --git a/types/motor-hat/tslint.json b/types/motor-hat/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/motor-hat/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/nuka-carousel/index.d.ts b/types/nuka-carousel/index.d.ts new file mode 100644 index 0000000000..b06403e703 --- /dev/null +++ b/types/nuka-carousel/index.d.ts @@ -0,0 +1,270 @@ +// Type definitions for nuka-carousel 4.2 +// Project: https://github.com/FormidableLabs/nuka-carousel +// Definitions by: Roman Charugin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export default class Carousel extends React.Component {} + +export type CellAlignProp = 'left' | 'center' | 'right'; + +export type HeightModeProp = 'first' | 'current' | 'max'; + +export type SlidesToScrollProp = number | 'auto'; + +export type SlideWidthProp = string | number; + +export interface SlideRenderControlProps { + /** + * Current slide index + */ + currentSlide: number; + /** + * Total amount of slides + */ + slideCount: number; + /** + * Current frame width (px) + */ + frameWidth: number; + /** + * Current slide width (px) + */ + slideWidth: number; + /** + * Slides to scroll at once + */ + slidesToScroll: number; + /** + * Space between slides, as an integer, but reflected as px + */ + cellSpacing: number; + /** + * Slides to show at once + */ + slidesToShow: number; + /** + * Infinite mode enabled + */ + wrapAround: boolean; + /** + * Go to the next slide method + */ + nextSlide: () => void; + /** + * Go to the previous slide method + */ + previousSlide: () => void; + /** + * Go to X slide method + * @param index Slide's index to go + */ + goToSlide: (index: number) => void; +} + +export type RenderControl = (props: SlideRenderControlProps) => JSX.Element; + +export interface CarouselProps { + /** + * Hook to be called after a slide is changed + * @param prevSlide Index of the previous slide + */ + afterSlide?: (prevSlide: number) => void; + /** + * Autoplay mode active + * @default false + */ + autoplay?: boolean; + /** + * Interval for autoplay iteration (ms) + * @default 3000 + */ + autoplayInterval?: number; + /** + * Hook to be called before a slide is changed + * @param currentSlide Index of the current slide + * @param endSlide Index of the last slide + */ + beforeSlide?: (currentSlide: number, endSlide: number) => void; + /** + * When displaying more than one slide, + * sets which position to anchor the current slide to + */ + cellAlign?: CellAlignProp; + /** + * Space between slides, as an integer, but reflected as px + */ + cellSpacing?: number; + /** + * Additional className + */ + className?: string; + /** + * Enable mouse swipe/dragging + */ + dragging?: boolean; + /** + * Animation easing function + * @see https://github.com/d3/d3-ease + */ + easing?: string; + /** + * Animation easing function when swipe exceeds edge + * @see https://github.com/d3/d3-ease + */ + edgeEasing?: string; + /** + * Used to set overflow style property on slider frame + * @default 'hidden' + */ + frameOverflow?: string; + /** + * Used to set the margin of the slider frame. + * Accepts any string dimension value such as "0px 20px" or "500px" + * @example '0px 20px' + * @example '500px' + */ + framePadding?: string; + /** + * Change the height of the slides based either on the first slide, + * the current slide, or the maximum height of all slides. + */ + heightMode?: HeightModeProp; + /** + * Initial height of the slides (px) + */ + initialSlideHeight?: number; + /** + * Initial width of the slides (px) + */ + initialSlideWidth?: number; + /** + * Window onResize callback + */ + onResize?: () => void; + /** + * Function for rendering top left control + */ + renderTopLeftControls?: RenderControl; + /** + * Function for rendering top center control + */ + renderTopCenterControls?: RenderControl; + /** + * Function for rendering top right control + */ + renderTopRightControls?: RenderControl; + /** + * Function for rendering center left control + */ + renderCenterLeftControls?: RenderControl; + /** + * Function for rendering center center control + */ + renderCenterCenterControls?: RenderControl; + /** + * Function for rendering center right control + */ + renderCenterRightControls?: RenderControl; + /** + * Function for rendering bottom left control + */ + renderBottomLeftControls?: RenderControl; + /** + * Function for rendering bottom center control + */ + renderBottomCenterControls?: RenderControl; + /** + * Function for rendering bottom right control + */ + renderBottomRightControls?: RenderControl; + /** + * Manually set the index of the slide to be shown + */ + slideIndex?: number; + /** + * Slides to scroll at once. Set to "auto" + * to always scroll the current number of visible slides + */ + slidesToScroll?: SlidesToScrollProp; + /** + * Slides to show at once + */ + slidesToShow?: number; + /** + * Manually set slideWidth + * @example '20px' + * @example 0.8 + */ + slideWidth?: SlideWidthProp; + /** + * Animation duration + */ + speed?: number; + /** + * Enable touch swipe/dragging + */ + swiping?: boolean; + /** + * Enable the slides to transition vertically + */ + vertical?: boolean; + /** + * Used to hardcode the slider width + * @example '80%' + * @example '500px' + */ + width?: string; + /** + * Sets infinite wrapAround mode + * @default false + */ + wrapAround?: boolean; +} + +export interface CarouselState { + /** + * Current slide index + */ + currentSlide: number; + /** + * Is dragging enabled + */ + dragging: boolean; + /** + * Current frame width + */ + frameWidth: number; + /** + * Current left value + */ + left: number; + /** + * Total amount of slides + */ + slideCount: number; + /** + * Slides to scroll at once + */ + slidesToScroll: number; + /** + * Current slide width + */ + slideWidth: SlideWidthProp; + /** + * Current top value + */ + top: number; + /** + * Easing function name + */ + easing: string; + /** + * Is infinite mode enabled + */ + isWrappingAround: boolean; + wrapToIndex: boolean; + resetWrapAroundPosition: boolean; +} diff --git a/types/nuka-carousel/nuka-carousel-tests.tsx b/types/nuka-carousel/nuka-carousel-tests.tsx new file mode 100644 index 0000000000..03df5e6251 --- /dev/null +++ b/types/nuka-carousel/nuka-carousel-tests.tsx @@ -0,0 +1,54 @@ +import * as React from 'react'; +import { render } from 'react-dom'; + +import Carousel, { CarouselProps } from 'nuka-carousel'; + +const props: CarouselProps = { + afterSlide: () => {}, + autoplay: true, + autoplayInterval: 5000, + beforeSlide: () => {}, + cellAlign: 'center', + cellSpacing: 500, + dragging: true, + easing: 'easePoly', + edgeEasing: 'easePolyInOut', + framePadding: '100px', + heightMode: 'max', + initialSlideHeight: 200, + initialSlideWidth: 500, + onResize: () => {}, + renderTopLeftControls: () =>