diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c812574f4a74d5..4ea6688a2ea6a5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -650,7 +650,7 @@ /types/brace-expansion/ @BendingBender /types/braces/ @vemoo @mrmlnc @rejunp /types/brainhubeu__react-carousel/ @jackall3n @sinchang @roberthebel -/types/braintree/ @smrubin @acdr @sedenardi @sebacampos +/types/braintree/ @smrubin @acdr @sebacampos @claudiowilson /types/braintree-web/ @daelmaak /types/braintree-web-drop-in/ @saoudrizwan @elmikosch /types/bramus__pagination-sequence/ @kristjanjokull @@ -1529,7 +1529,6 @@ /types/dinero.js/ @BendingBender @juandaco @peterblazejewicz /types/dingtalk-robot-sender/ @bangbang93 /types/dir-glob/ @BendingBender -/types/dir-walker-gen/ @aynurin /types/director/ @pastelmind /types/directory-structure-json/ @vdistortion /types/dirname-regex/ @BendingBender @@ -2218,6 +2217,7 @@ /types/fnando__sparkline/ @grabofus /types/fnv-lite/ @marcind /types/fnv-plus/ @mihnea-s +/types/focus-group/ @m-kawafuji /types/focus-within/ @eramdam /types/fold-to-ascii/ @mogzol /types/folder-hash/ @thekevinbrown @peterblazejewicz @marc136 @@ -2885,7 +2885,6 @@ /types/git-user-email/ @BendingBender /types/git-user-name/ @BendingBender /types/git-username/ @BendingBender -/types/gitana/ @tenoriojuann /types/gitconfiglocal/ @ffflorian /types/github-from-package/ @e6nlaq /types/github-label-sync/ @EndBug @@ -5574,7 +5573,6 @@ /types/parcel-bundler/ @pinage404 /types/parcel-env/ @fathyb /types/parcel__watcher/ @ascorbic -/types/parent-package-json/ @sgmccli /types/parents/ @TeamworkGuy2 /types/parity-pmd/ @leovujanic /types/parity-pmr/ @leovujanic @@ -7833,7 +7831,7 @@ /types/system-service/ @leocwlam /types/system-sleep/ @ArthurKa /types/system-task/ @leocwlam -/types/systemjs/ @joeldenning +/types/systemjs/ @jolyndenning /types/systemjs/v0/ @ludohenin @NathanWalker @GiedriusGrabauskas @aluanhaddad /types/table-resolver/ @junalmeida /types/tableau/ @protip diff --git a/attw.json b/attw.json index 1c59b0892ce60b..ed9daccb938e24 100644 --- a/attw.json +++ b/attw.json @@ -89,7 +89,6 @@ "durandal", "dygraphs", "easy-speech", - "editorjs__header", "email-prompt", "ember__ordered-set", "ember__ordered-set/v3", diff --git a/notNeededPackages.json b/notNeededPackages.json index bde714b4534417..b4a7970b9bd8c6 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1617,6 +1617,10 @@ "libraryName": "editly", "asOfVersion": "0.11.3" }, + "editorjs__header": { + "libraryName": "@editorjs/header", + "asOfVersion": "2.8.2" + }, "eev": { "libraryName": "eev", "asOfVersion": "0.1.2" @@ -3237,6 +3241,10 @@ "libraryName": "jsonata", "asOfVersion": "1.5.0" }, + "jsonic": { + "libraryName": "jsonic", + "asOfVersion": "2.15.1" + }, "jsonp-body": { "libraryName": "jsonp-body", "asOfVersion": "1.1.0" @@ -4469,6 +4477,10 @@ "libraryName": "on-change", "asOfVersion": "1.1.0" }, + "onesignal-cordova-plugin": { + "libraryName": "onesignal-cordova-plugin", + "asOfVersion": "3.0.0" + }, "onetime": { "libraryName": "onetime", "asOfVersion": "4.0.0" @@ -5923,6 +5935,10 @@ "libraryName": "react-webcam", "asOfVersion": "3.0.0" }, + "react-widgets": { + "libraryName": "react-widgets", + "asOfVersion": "5.0.0" + }, "react-youtube": { "libraryName": "react-youtube", "asOfVersion": "7.10.0" @@ -7007,6 +7023,10 @@ "libraryName": "ttf2woff2", "asOfVersion": "6.0.0" }, + "tunnel-ssh": { + "libraryName": "tunnel-ssh", + "asOfVersion": "5.1.0" + }, "tus-js-client": { "libraryName": "tus-js-client", "asOfVersion": "2.1.0" diff --git a/types/chai/chai-tests.ts b/types/chai/chai-tests.ts index 3e5b107beb5854..2a09d9108bd2ab 100644 --- a/types/chai/chai-tests.ts +++ b/types/chai/chai-tests.ts @@ -117,6 +117,9 @@ function equal() { function containSubset() { expect({}).to.containSubset({}); ({}).should.containSubset({}); + assert.containSubset({}, {}); + assert.containsSubset({}, {}); + assert.doesNotContainSubset({}, {}); } function _typeof() { diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index cfd08eb2aab0db..58c89c306c5443 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -537,6 +537,24 @@ declare global { */ containSubset(val: any, exp: any, msg?: string): void; + /** + * Partially matches actual and expected. + * + * @param actual Actual value. + * @param expected Potential subset of the value. + * @param message Message to display on error. + */ + containsSubset(val: any, exp: any, msg?: string): void; + + /** + * No partial match between actual and expected exists. + * + * @param actual Actual value. + * @param expected Potential subset of the value. + * @param message Message to display on error. + */ + doesNotContainSubset(val: any, exp: any, msg?: string): void; + /** * Asserts valueToCheck is strictly greater than (>) valueToBeAbove. * diff --git a/types/diff/diff-tests.ts b/types/diff/diff-tests.ts index bd1db9d3042bf2..256967f4f6acb0 100644 --- a/types/diff/diff-tests.ts +++ b/types/diff/diff-tests.ts @@ -115,7 +115,9 @@ function verifyApplyMethods(oldStr: string, newStr: string, uniDiffStr: string) }, patched(index, content) { index; // $ExpectType ParsedDiff - verifyApply.push(content); + if (content !== false) { + verifyApply.push(content); + } }, complete(err) { if (err) { diff --git a/types/diff/index.d.ts b/types/diff/index.d.ts index 93edd6c3c4b3c9..f44b69be39aec4 100644 --- a/types/diff/index.d.ts +++ b/types/diff/index.d.ts @@ -127,7 +127,7 @@ export interface ApplyPatchOptions { export interface ApplyPatchesOptions extends ApplyPatchOptions { loadFile(index: ParsedDiff, callback: (err: any, data: string) => void): void; - patched(index: ParsedDiff, content: string, callback: (err: any) => void): void; + patched(index: ParsedDiff, content: string | false, callback: (err: any) => void): void; complete(err: any): void; } diff --git a/types/dir-walker-gen/package.json b/types/dir-walker-gen/package.json index 5bc1c088a3f519..b714884fb9dce9 100644 --- a/types/dir-walker-gen/package.json +++ b/types/dir-walker-gen/package.json @@ -8,10 +8,5 @@ "devDependencies": { "@types/dir-walker-gen": "workspace:." }, - "owners": [ - { - "name": "Shavkat Aynurin", - "githubUsername": "aynurin" - } - ] + "owners": [] } diff --git a/types/editorjs__header/editorjs__header-tests.ts b/types/editorjs__header/editorjs__header-tests.ts deleted file mode 100644 index 8d5ccb8f4c0925..00000000000000 --- a/types/editorjs__header/editorjs__header-tests.ts +++ /dev/null @@ -1,8 +0,0 @@ -import Header from "@editorjs/header"; - -const header = new Header(); - -header.setLevel(2); -header.data; - -Header.isReadOnlySupported; diff --git a/types/editorjs__header/index.d.ts b/types/editorjs__header/index.d.ts deleted file mode 100644 index f5c3871b0c045b..00000000000000 --- a/types/editorjs__header/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -interface HeaderData { - text: string; - level: number; -} - -interface HeaderConfig { - placeholder: string; - levels: number[]; - defaultLevel: number; -} - -interface Level { - number: number; - tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; - svg: string; -} - -declare class Header { - constructor(config?: { data: HeaderData; config: HeaderConfig; api: object; readOnly: boolean }); - - normalizeData(data: HeaderData): HeaderData; - - setLevel(level: number): void; - - merge(data: HeaderData): void; - - validate(blockData: HeaderData): boolean; - - save(toolsContent: HTMLElement): HeaderData; - - static get conversionConfig(): { export: string; import: string }; - - static get sanitize(): { level: boolean; text: object }; - - static get isReadOnlySupported(): boolean; - - get data(): HeaderData; - - set data(data: HeaderData); - - getTag(): HTMLElement; - - get currentLevel(): Level; - - get defaultLevel(): Level; - - get levels(): Level[]; - - static get toolbox(): { - icon: string; - title: string; - }; -} - -export default Header; diff --git a/types/editorjs__header/package.json b/types/editorjs__header/package.json deleted file mode 100644 index 489943cb86cdf7..00000000000000 --- a/types/editorjs__header/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "private": true, - "name": "@types/editorjs__header", - "version": "2.6.9999", - "projects": [ - "https://github.com/editor-js/header#readme (Does not have to be to GitHub", - "but prefer linking to a source code repository rather than to a project website.)" - ], - "devDependencies": { - "@types/editorjs__header": "workspace:." - }, - "owners": [ - { - "name": "Maykon Oliveira", - "githubUsername": "maykon-oliveira" - } - ] -} diff --git a/types/estree/estree-tests.ts b/types/estree/estree-tests.ts index 24040bfcbb662e..3ee47cc48596d5 100644 --- a/types/estree/estree-tests.ts +++ b/types/estree/estree-tests.ts @@ -84,6 +84,7 @@ declare var moduleDeclaration: ESTree.ModuleDeclaration; declare var moduleSpecifier: ESTree.ModuleSpecifier; declare var importDeclaration: ESTree.ImportDeclaration; declare var importSpecifier: ESTree.ImportSpecifier; +declare var importAttribute: ESTree.ImportAttribute; declare var importDefaultSpecifier: ESTree.ImportDefaultSpecifier; declare var importNamespaceSpecifier: ESTree.ImportNamespaceSpecifier; declare var exportNamedDeclaration: ESTree.ExportNamedDeclaration; @@ -261,6 +262,11 @@ if (memberExpressionOrCallExpression.type === "MemberExpression") { expressionOrSpread = callExpression.arguments[0]; } +// ImportExpression +var importExpression: ESTree.ImportExpression; +expression = importExpression.source; +expressionMaybe = importExpression.options; + // Declarations var functionDeclaration: ESTree.FunctionDeclaration; var identifierOrNull: ESTree.Identifier | null = functionDeclaration.id; @@ -286,6 +292,7 @@ classDeclaration.id = null; var identifierOrLiteral: ESTree.Identifier | ESTree.Literal; identifierOrLiteral = importSpecifier.imported; +identifierOrLiteral = importAttribute.key; identifierOrLiteral = exportSpecifier.local; identifierOrLiteral = exportSpecifier.exported; var identifierOrLiteralOrNull: ESTree.Identifier | ESTree.Literal | null; diff --git a/types/estree/index.d.ts b/types/estree/index.d.ts index 81a351f9d67eee..1c132655f0ba5e 100644 --- a/types/estree/index.d.ts +++ b/types/estree/index.d.ts @@ -633,6 +633,7 @@ export interface BaseModuleSpecifier extends BaseNode { export interface ImportDeclaration extends BaseModuleDeclaration { type: "ImportDeclaration"; specifiers: Array; + attributes: ImportAttribute[]; source: Literal; } @@ -641,9 +642,16 @@ export interface ImportSpecifier extends BaseModuleSpecifier { imported: Identifier | Literal; } +export interface ImportAttribute extends BaseNode { + type: "ImportAttribute"; + key: Identifier | Literal; + value: Literal; +} + export interface ImportExpression extends BaseExpression { type: "ImportExpression"; source: Expression; + options?: Expression | null | undefined; } export interface ImportDefaultSpecifier extends BaseModuleSpecifier { @@ -658,6 +666,7 @@ export interface ExportNamedDeclaration extends BaseModuleDeclaration { type: "ExportNamedDeclaration"; declaration?: Declaration | null | undefined; specifiers: ExportSpecifier[]; + attributes: ImportAttribute[]; source?: Literal | null | undefined; } @@ -675,6 +684,7 @@ export interface ExportDefaultDeclaration extends BaseModuleDeclaration { export interface ExportAllDeclaration extends BaseModuleDeclaration { type: "ExportAllDeclaration"; exported: Identifier | Literal | null; + attributes: ImportAttribute[]; source: Literal; } diff --git a/types/editorjs__header/.npmignore b/types/focus-group/.npmignore similarity index 100% rename from types/editorjs__header/.npmignore rename to types/focus-group/.npmignore diff --git a/types/focus-group/focus-group-tests.ts b/types/focus-group/focus-group-tests.ts new file mode 100644 index 00000000000000..a9850eedff5811 --- /dev/null +++ b/types/focus-group/focus-group-tests.ts @@ -0,0 +1,98 @@ +import createFocusGroup from "focus-group"; + +// $ExpectType FocusGroup +const focusGroup = createFocusGroup({ members: [document.createElement("button")] }); + +// $ExpectType FocusGroup +createFocusGroup({ members: document.querySelectorAll("button") }); + +// $ExpectType FocusGroup +createFocusGroup({ + members: [{ node: document.createElement("button"), text: "string" }], + keybindings: { + next: [{ + altKey: true, + charCode: 104, + code: "ArrowDown", + ctrlKey: true, + isComposing: true, + key: "ArrowRight", + keyCode: 40, + location: 0, + metaKey: true, + repeat: true, + shiftKey: true, + DOM_KEY_LOCATION_STANDARD: KeyboardEvent.DOM_KEY_LOCATION_STANDARD, + DOM_KEY_LOCATION_LEFT: KeyboardEvent.DOM_KEY_LOCATION_LEFT, + DOM_KEY_LOCATION_RIGHT: KeyboardEvent.DOM_KEY_LOCATION_RIGHT, + DOM_KEY_LOCATION_NUMPAD: KeyboardEvent.DOM_KEY_LOCATION_NUMPAD, + }], + prev: [{ key: "ArrowUp" }, { key: "ArrowLeft" }], + first: { + altKey: true, + charCode: 103, + code: "Home", + ctrlKey: true, + isComposing: true, + key: "Home", + keyCode: 36, + location: 0, + metaKey: true, + repeat: true, + shiftKey: true, + DOM_KEY_LOCATION_STANDARD: KeyboardEvent.DOM_KEY_LOCATION_STANDARD, + DOM_KEY_LOCATION_LEFT: KeyboardEvent.DOM_KEY_LOCATION_LEFT, + DOM_KEY_LOCATION_RIGHT: KeyboardEvent.DOM_KEY_LOCATION_RIGHT, + DOM_KEY_LOCATION_NUMPAD: KeyboardEvent.DOM_KEY_LOCATION_NUMPAD, + }, + last: { keyCode: 75, metaKey: true }, + }, + wrap: true, + stringSearch: true, + stringSearchDelay: 800, +}); + +// $ExpectType FocusGroup +focusGroup.activate(); + +// $ExpectType FocusGroup +focusGroup.deactivate(); + +// $ExpectType FocusGroup +focusGroup.addMember( + document.createElement("button"), + 0, +); + +// $ExpectType FocusGroup +focusGroup.addMember( + { node: document.createElement("button"), text: "string" }, + 0, +); + +// $ExpectType FocusGroup +focusGroup.removeMember(0); + +// $ExpectType FocusGroup +focusGroup.clearMembers(); + +// $ExpectType FocusGroup +focusGroup.setMembers([document.createElement("button")]); + +// $ExpectType FocusGroup +focusGroup.setMembers(document.querySelectorAll("button")); + +// $ExpectType FocusGroup +focusGroup.setMembers([{ node: document.createElement("button"), text: "string" }]); + +// $ExpectType FocusGroupMember[] +focusGroup.getMembers(); + +// $ExpectType FocusGroup +focusGroup.focusNodeAtIndex(0); + +// $ExpectType number +focusGroup.moveFocusForward(); + +// $ExpectType number +focusGroup.moveFocusBack(); diff --git a/types/focus-group/index.d.ts b/types/focus-group/index.d.ts new file mode 100644 index 00000000000000..32873091ee8d44 --- /dev/null +++ b/types/focus-group/index.d.ts @@ -0,0 +1,122 @@ +declare namespace createFocusGroup { + type FocusGroupTriggers = Partial< + Pick< + KeyboardEvent, + | "altKey" + | "charCode" + | "code" + | "ctrlKey" + | "isComposing" + | "key" + | "keyCode" + | "location" + | "metaKey" + | "repeat" + | "shiftKey" + | "DOM_KEY_LOCATION_STANDARD" + | "DOM_KEY_LOCATION_LEFT" + | "DOM_KEY_LOCATION_RIGHT" + | "DOM_KEY_LOCATION_NUMPAD" + > + >; + + interface FocusGroupMember { + /** + * The DOM node. + */ + node: Element; + /** + * The text that should be associated with the node for letter-navigation. + */ + text?: string; + } + + interface FocusGroupOptions { + /** + * Designate initial members of the group. + * + * @defaultValue `[]` + */ + members?: ReadonlyArray | NodeListOf | FocusGroupMember[]; + /** + * Specify which key events should move the focus forward, back, to the first member, or to the last member through the group. + * + * @defaultValue + * ``` + * { + * next: { keyCode: 40 }, // ArrowDown + * prev: { keyCode: 38 }, // ArrowUp + * } + * ``` + */ + keybindings?: Partial>; + /** + * If true, when the arrow keys are moving focus they will wrap around the group. + */ + wrap?: boolean; + /** + * If true, string searching is enabled. + * + * @defaultValue `false` + */ + stringSearch?: boolean; + /** + * The number of milliseconds that should elapse between the user's last letter entry (with the keyboard) and a refresh of the string search. + * @defaultValue `800` + */ + stringSearchDelay?: number; + } + + interface FocusGroup { + /** + * Start this group listening to keyboard events and responding accordingly. + */ + activate(): FocusGroup; + /** + * Stop this group listening to keyboard events. + */ + deactivate(): FocusGroup; + /** + * Add a member to the group. + */ + addMember(member: Element | FocusGroupMember, index?: number): FocusGroup; + /** + * Remove a member from the group. + */ + removeMember(member: Element | number): FocusGroup; + /** + * Empty the focus group of members. + */ + clearMembers(): FocusGroup; + /** + * Set the focus group's members (clearing any that already exist). + */ + setMembers(members: ReadonlyArray | NodeListOf | FocusGroupMember[]): FocusGroup; + /** + * Returns the focus group's current array of members. + */ + getMembers(): FocusGroupMember[]; + /** + * Focuses the node at a particular index in the focus group's member array. + * If no member exists at that index, does nothing. + */ + focusNodeAtIndex(index: number): FocusGroup; + /** + * Moves the focus forward one member, if focus is already within the group. + * If focus is not within the group, does nothing. + */ + moveFocusForward(): number; + /** + * Moves the focus back one member, if focus is already within the group. + * If focus is not within the group, does nothing. + */ + moveFocusBack(): number; + } +} + +/** + * Returns a new focus group instance. + */ +declare function createFocusGroup(options: createFocusGroup.FocusGroupOptions): createFocusGroup.FocusGroup; + +export = createFocusGroup; diff --git a/types/focus-group/package.json b/types/focus-group/package.json new file mode 100644 index 00000000000000..36c86431a7e46b --- /dev/null +++ b/types/focus-group/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/focus-group", + "version": "0.3.9999", + "projects": [ + "https://github.com/davidtheclark/focus-group#readme" + ], + "devDependencies": { + "@types/focus-group": "workspace:." + }, + "owners": [ + { + "name": "Masashi Kawafuji", + "githubUsername": "m-kawafuji" + } + ] +} diff --git a/types/editorjs__header/tsconfig.json b/types/focus-group/tsconfig.json similarity index 91% rename from types/editorjs__header/tsconfig.json rename to types/focus-group/tsconfig.json index 81f64239514433..d8a86be902e220 100644 --- a/types/editorjs__header/tsconfig.json +++ b/types/focus-group/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "editorjs__header-tests.ts" + "focus-group-tests.ts" ] } diff --git a/types/frida-gum/frida-gum-tests.ts b/types/frida-gum/frida-gum-tests.ts index 798db595a911ae..d2ae43d2e8a83a 100644 --- a/types/frida-gum/frida-gum-tests.ts +++ b/types/frida-gum/frida-gum-tests.ts @@ -443,6 +443,12 @@ const threadObserver = Process.attachThreadObserver({ }); threadObserver.detach(); +// $ExpectType Promise +Process.runOnThread(1, () => {}); + +// $ExpectType Promise +Process.runOnThread(1, () => true); + const moduleObserver = Process.attachModuleObserver({ onAdded(module) { // $ExpectType Module diff --git a/types/frida-gum/index.d.ts b/types/frida-gum/index.d.ts index 6c3eb6b0f0688c..b7f5e3f8d2de4d 100644 --- a/types/frida-gum/index.d.ts +++ b/types/frida-gum/index.d.ts @@ -380,6 +380,20 @@ declare namespace Process { */ function attachThreadObserver(callbacks: ThreadObserverCallbacks): ThreadObserver; + /** + * Runs the JavaScript function `callback` on the thread specified by `id`. + * Must be used with extreme caution due to the thread potentially being + * interrupted in non-reentrant code. For example, you could be interrupting + * it while it's in the middle of some delicate code, holding a specific + * non-recursive lock, which you then try to implicitly acquire again when + * you call some function. + * + * @param id ID of the thread to run on. + * @param callback Function to run. + * @returns A Promise that resolves to the value returned by `callback`. + */ + function runOnThread(id: ThreadId, callback: () => T): Promise; + /** * Looks up a module by address. Returns null if not found. */ diff --git a/types/fslightbox-react/fslightbox-react-tests.tsx b/types/fslightbox-react/fslightbox-react-tests.tsx index f9abaaab8a5cfb..39cfef9f5aa0b3 100644 --- a/types/fslightbox-react/fslightbox-react-tests.tsx +++ b/types/fslightbox-react/fslightbox-react-tests.tsx @@ -41,6 +41,7 @@ class Test extends React.Component { showThumbsOnMount={false} disableThumbs={false} openOnMount={false} + autoplay disableBackgroundClose={true} disableLocalStorage={true} disableSlideSwiping={true} diff --git a/types/fslightbox-react/index.d.ts b/types/fslightbox-react/index.d.ts index d7dcc2b16079b5..17aa00acd00c01 100644 --- a/types/fslightbox-react/index.d.ts +++ b/types/fslightbox-react/index.d.ts @@ -49,6 +49,7 @@ declare namespace FsLightbox { // sources maxYoutubeVideoDimensions?: VideoDimensions | undefined; + autoplay?: boolean | undefined; // thumbs thumbs?: Array | undefined; // pro feature @@ -60,7 +61,6 @@ declare namespace FsLightbox { // toolbar customToolbarButtons?: CustomToolbarButtonProps[] | undefined; // pro feature - // preferences disableBackgroundClose?: boolean | undefined; disableSlideSwiping?: boolean | undefined; diff --git a/types/fslightbox-react/package.json b/types/fslightbox-react/package.json index 3d58907de2df90..fcab07c2d9a4b9 100644 --- a/types/fslightbox-react/package.json +++ b/types/fslightbox-react/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/fslightbox-react", - "version": "1.7.9999", + "version": "1.8.9999", "projects": [ "https://fslightbox.com/" ], diff --git a/types/gitana/package.json b/types/gitana/package.json index 39c401b6063a7b..a650793412028a 100644 --- a/types/gitana/package.json +++ b/types/gitana/package.json @@ -8,10 +8,5 @@ "devDependencies": { "@types/gitana": "workspace:." }, - "owners": [ - { - "name": "Juan E. Tenorio Arzola", - "githubUsername": "tenoriojuann" - } - ] + "owners": [] } diff --git a/types/jsonic/.npmignore b/types/jsonic/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/jsonic/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/jsonic/index.d.ts b/types/jsonic/index.d.ts deleted file mode 100644 index 3b84a2c3883334..00000000000000 --- a/types/jsonic/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -declare function jsonic(text: string): any; -declare namespace jsonic { - interface Options { - depth?: number | undefined; - maxitems?: number | undefined; - maxchars?: number | undefined; - omit?: string[] | undefined; - exclude?: string[] | undefined; - } - - function stringify(val: any, opts?: Options): string; -} - -export = jsonic; diff --git a/types/jsonic/jsonic-tests.ts b/types/jsonic/jsonic-tests.ts deleted file mode 100644 index f17d6991519baf..00000000000000 --- a/types/jsonic/jsonic-tests.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as jsonic from "jsonic"; - -jsonic("a:x, b:y z"); -jsonic.stringify( - { a: "a", b: "b", c: { c1: "c1" } }, - { depth: 1, omit: ["a"], exclude: ["b"] }, -); diff --git a/types/jsonic/package.json b/types/jsonic/package.json deleted file mode 100644 index b3af4726d6d41c..00000000000000 --- a/types/jsonic/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "private": true, - "name": "@types/jsonic", - "version": "0.3.9999", - "projects": [ - "https://github.com/rjrodger/jsonic" - ], - "devDependencies": { - "@types/jsonic": "workspace:." - }, - "owners": [ - { - "name": "Rong SHen", - "githubUsername": "jacobbubu" - } - ] -} diff --git a/types/jsonic/tsconfig.json b/types/jsonic/tsconfig.json deleted file mode 100644 index 6ada708ed58c85..00000000000000 --- a/types/jsonic/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "jsonic-tests.ts" - ] -} diff --git a/types/n3/index.d.ts b/types/n3/index.d.ts index 7e2a485261dd29..e7311ddc40c25f 100644 --- a/types/n3/index.d.ts +++ b/types/n3/index.d.ts @@ -263,8 +263,10 @@ export class StreamWriter extends stream.Tran import(stream: RDF.Stream): EventEmitter; } -export class StoreFactory implements RDF.DatasetCoreFactory { - dataset(quads?: RDF.BaseQuad[]): Store; +export class StoreFactory + implements RDF.DatasetCoreFactory, RDF.DatasetFactory +{ + dataset(quads?: RDF.BaseQuad[] | RDF.DatasetCore): Store; } export interface Rule { @@ -287,8 +289,22 @@ export class Store< Q_N3 extends BaseQuad = Quad, OutQuad extends RDF.BaseQuad = RDF.Quad, InQuad extends RDF.BaseQuad = RDF.Quad, -> implements RDF.Store, RDF.DatasetCore { - constructor(triples?: Q_RDF[], options?: StoreOptions); +> implements RDF.Store, RDF.Dataset { + constructor(triples?: Q_RDF[] | RDF.Dataset, options?: StoreOptions); + addAll(quads: RDF.Dataset | InQuad[]): this; + contains(other: RDF.Dataset): boolean; + deleteMatches(subject?: RDF.Term, predicate?: RDF.Term, object?: RDF.Term, graph?: RDF.Term): this; + difference(other: RDF.Dataset): RDF.Dataset; + equals(other: RDF.Dataset): boolean; + filter(iteratee: (quad: OutQuad, dataset: this) => boolean): RDF.Dataset; + intersection(other: RDF.Dataset): RDF.Dataset; + map(iteratee: (quad: OutQuad, dataset: RDF.Dataset) => OutQuad): RDF.Dataset; + reduce(callback: (accumulator: A, quad: OutQuad, dataset: this) => A, initialValue?: A): A; + toArray(): OutQuad[]; + toCanonical(): string; + toStream(): RDF.Stream; + toString(): string; + union(quads: RDF.Dataset): RDF.Dataset; readonly size: number; add(quad: InQuad): this; addQuad( @@ -302,7 +318,7 @@ export class Store< addQuads(quads: Q_RDF[]): void; delete(quad: InQuad): this; has(quad: InQuad): boolean; - import(stream: RDF.Stream): EventEmitter; + import(stream: RDF.Stream): EventEmitter & Promise; removeQuad( subject: Q_RDF["subject"], predicate: Q_RDF["predicate"], @@ -327,10 +343,13 @@ export class Store< predicate?: Term | null, object?: Term | null, graph?: Term | null, - ): RDF.Stream & RDF.DatasetCore; + ): RDF.Stream & RDF.Dataset; countQuads(subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): number; + forEach(callback: (quad: OutQuad, dataset: this) => void): void; forEach(callback: QuadCallback, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): void; + every(iteratee: (quad: OutQuad, dataset: this) => boolean): boolean; every(callback: QuadPredicate, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): boolean; + some(iteratee: (quad: OutQuad, dataset: this) => boolean): boolean; some(callback: QuadPredicate, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): boolean; getSubjects(predicate: OTerm, object: OTerm, graph: OTerm): Array; forSubjects(callback: (result: Q_N3["subject"]) => void, predicate: OTerm, object: OTerm, graph: OTerm): void; diff --git a/types/node/fs.d.ts b/types/node/fs.d.ts index aba529b50791a7..0b6d52a405fdac 100644 --- a/types/node/fs.d.ts +++ b/types/node/fs.d.ts @@ -4012,7 +4012,7 @@ declare module "fs" { export function writev( fd: number, buffers: readonly NodeJS.ArrayBufferView[], - position: number, + position: number | null, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, ): void; export interface WriteVResult { @@ -4057,7 +4057,7 @@ declare module "fs" { export function readv( fd: number, buffers: readonly NodeJS.ArrayBufferView[], - position: number, + position: number | null, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, ): void; export interface ReadVResult { diff --git a/types/node/stream/consumers.d.ts b/types/node/stream/consumers.d.ts index 5ad9cbab98829f..746d6e508266ac 100644 --- a/types/node/stream/consumers.d.ts +++ b/types/node/stream/consumers.d.ts @@ -1,11 +1,37 @@ +/** + * The utility consumer functions provide common options for consuming + * streams. + * @since v16.7.0 + */ declare module "stream/consumers" { import { Blob as NodeBlob } from "node:buffer"; - import { Readable } from "node:stream"; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; + import { ReadableStream as WebReadableStream } from "node:stream/web"; + /** + * @since v16.7.0 + * @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream. + */ + function arrayBuffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with a `Blob` containing the full contents of the stream. + */ + function blob(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with a `Buffer` containing the full contents of the stream. + */ + function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with the contents of the stream parsed as a + * UTF-8 encoded string that is then passed through `JSON.parse()`. + */ + function json(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string. + */ + function text(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; } declare module "node:stream/consumers" { export * from "stream/consumers"; diff --git a/types/node/test/fs.ts b/types/node/test/fs.ts index 9d161dbac4f0fb..317fb422216c73 100644 --- a/types/node/test/fs.ts +++ b/types/node/test/fs.ts @@ -425,6 +425,20 @@ async function testPromisify() { (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => { }, ); + fs.writev( + 1, + [Buffer.from("123")] as readonly NodeJS.ArrayBufferView[], + 123, + (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => { + }, + ); + fs.writev( + 1, + [Buffer.from("123")] as readonly NodeJS.ArrayBufferView[], + null, + (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => { + }, + ); const bytesWritten = fs.writevSync(1, [Buffer.from("123")] as readonly NodeJS.ArrayBufferView[]); } @@ -622,6 +636,13 @@ async function testPromisify() { (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => { }, ); + fs.readv( + 123, + [Buffer.from("wut")] as readonly NodeJS.ArrayBufferView[], + null, + (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => { + }, + ); } async function testStat( diff --git a/types/node/test/stream.ts b/types/node/test/stream.ts index 38a6f907293bed..4ba432cec98f2b 100644 --- a/types/node/test/stream.ts +++ b/types/node/test/stream.ts @@ -18,7 +18,7 @@ import { Blob } from "node:buffer"; import { Http2ServerResponse } from "node:http2"; import { performance } from "node:perf_hooks"; import { stdout } from "node:process"; -import { arrayBuffer, blob, buffer, json, text } from "node:stream/consumers"; +import * as consumers from "node:stream/consumers"; import { finished as finishedPromise, pipeline as pipelinePromise } from "node:stream/promises"; import { ReadableStream, ReadableStreamBYOBReader, TransformStream, WritableStream } from "node:stream/web"; import { setInterval as every, setTimeout as wait } from "node:timers/promises"; @@ -501,25 +501,18 @@ async function streamPipelineAsyncPromiseOptions() { } async function testConsumers() { - const r = createReadStream("file.txt"); + let consumable!: ReadableStream | Readable | AsyncGenerator; - // $ExpectType string - await text(r); - // $ExpectType unknown - await json(r); - // $ExpectType Buffer || Buffer - await buffer(r); // $ExpectType ArrayBuffer - await arrayBuffer(r); + await consumers.arrayBuffer(consumable); // $ExpectType Blob - await blob(r); - - const iterable: AsyncGenerator = async function*() {}(); - await buffer(iterable); - - const iterator: AsyncIterator = { next: () => iterable.next() }; - // @ts-expect-error - await buffer(iterator); + await consumers.blob(consumable); + // $ExpectType Buffer || Buffer + await consumers.buffer(consumable); + // $ExpectType unknown + await consumers.json(consumable); + // $ExpectType string + await consumers.text(consumable); } // https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options diff --git a/types/node/v18/fs.d.ts b/types/node/v18/fs.d.ts index 4ae9be0e4fccd9..818e357a8af366 100644 --- a/types/node/v18/fs.d.ts +++ b/types/node/v18/fs.d.ts @@ -4023,7 +4023,7 @@ declare module "fs" { export function writev( fd: number, buffers: readonly NodeJS.ArrayBufferView[], - position: number, + position: number | null, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, ): void; export interface WriteVResult { @@ -4066,7 +4066,7 @@ declare module "fs" { export function readv( fd: number, buffers: readonly NodeJS.ArrayBufferView[], - position: number, + position: number | null, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, ): void; export interface ReadVResult { diff --git a/types/node/v18/stream/consumers.d.ts b/types/node/v18/stream/consumers.d.ts index 5ad9cbab98829f..746d6e508266ac 100644 --- a/types/node/v18/stream/consumers.d.ts +++ b/types/node/v18/stream/consumers.d.ts @@ -1,11 +1,37 @@ +/** + * The utility consumer functions provide common options for consuming + * streams. + * @since v16.7.0 + */ declare module "stream/consumers" { import { Blob as NodeBlob } from "node:buffer"; - import { Readable } from "node:stream"; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; + import { ReadableStream as WebReadableStream } from "node:stream/web"; + /** + * @since v16.7.0 + * @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream. + */ + function arrayBuffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with a `Blob` containing the full contents of the stream. + */ + function blob(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with a `Buffer` containing the full contents of the stream. + */ + function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with the contents of the stream parsed as a + * UTF-8 encoded string that is then passed through `JSON.parse()`. + */ + function json(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string. + */ + function text(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; } declare module "node:stream/consumers" { export * from "stream/consumers"; diff --git a/types/node/v18/test/stream.ts b/types/node/v18/test/stream.ts index 044f3587d837b6..5179c7ec6f03d2 100644 --- a/types/node/v18/test/stream.ts +++ b/types/node/v18/test/stream.ts @@ -17,7 +17,7 @@ import { Blob } from "node:buffer"; import { Http2ServerResponse } from "node:http2"; import { performance } from "node:perf_hooks"; import { stdout } from "node:process"; -import { arrayBuffer, blob, buffer, json, text } from "node:stream/consumers"; +import * as consumers from "node:stream/consumers"; import { finished as finishedPromise, pipeline as pipelinePromise } from "node:stream/promises"; import { ReadableStream, ReadableStreamBYOBReader, TransformStream, WritableStream } from "node:stream/web"; import { setInterval as every } from "node:timers/promises"; @@ -496,18 +496,18 @@ async function streamPipelineAsyncPromiseOptions() { } async function testConsumers() { - const r = createReadStream("file.txt"); + let consumable!: ReadableStream | Readable | AsyncGenerator; - // $ExpectType string - await text(r); - // $ExpectType unknown - await json(r); - // $ExpectType Buffer || Buffer - await buffer(r); // $ExpectType ArrayBuffer - await arrayBuffer(r); + await consumers.arrayBuffer(consumable); // $ExpectType Blob - await blob(r); + await consumers.blob(consumable); + // $ExpectType Buffer || Buffer + await consumers.buffer(consumable); + // $ExpectType unknown + await consumers.json(consumable); + // $ExpectType string + await consumers.text(consumable); } // https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options diff --git a/types/node/v20/fs.d.ts b/types/node/v20/fs.d.ts index 9f708df966ae77..5a5be8d565a9a2 100644 --- a/types/node/v20/fs.d.ts +++ b/types/node/v20/fs.d.ts @@ -4013,7 +4013,7 @@ declare module "fs" { export function writev( fd: number, buffers: readonly NodeJS.ArrayBufferView[], - position: number, + position: number | null, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, ): void; export interface WriteVResult { @@ -4058,7 +4058,7 @@ declare module "fs" { export function readv( fd: number, buffers: readonly NodeJS.ArrayBufferView[], - position: number, + position: number | null, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, ): void; export interface ReadVResult { diff --git a/types/node/v20/stream/consumers.d.ts b/types/node/v20/stream/consumers.d.ts index 5ad9cbab98829f..746d6e508266ac 100644 --- a/types/node/v20/stream/consumers.d.ts +++ b/types/node/v20/stream/consumers.d.ts @@ -1,11 +1,37 @@ +/** + * The utility consumer functions provide common options for consuming + * streams. + * @since v16.7.0 + */ declare module "stream/consumers" { import { Blob as NodeBlob } from "node:buffer"; - import { Readable } from "node:stream"; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; + import { ReadableStream as WebReadableStream } from "node:stream/web"; + /** + * @since v16.7.0 + * @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream. + */ + function arrayBuffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with a `Blob` containing the full contents of the stream. + */ + function blob(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with a `Buffer` containing the full contents of the stream. + */ + function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with the contents of the stream parsed as a + * UTF-8 encoded string that is then passed through `JSON.parse()`. + */ + function json(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; + /** + * @since v16.7.0 + * @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string. + */ + function text(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; } declare module "node:stream/consumers" { export * from "stream/consumers"; diff --git a/types/node/v20/test/stream.ts b/types/node/v20/test/stream.ts index 38a6f907293bed..4ba432cec98f2b 100644 --- a/types/node/v20/test/stream.ts +++ b/types/node/v20/test/stream.ts @@ -18,7 +18,7 @@ import { Blob } from "node:buffer"; import { Http2ServerResponse } from "node:http2"; import { performance } from "node:perf_hooks"; import { stdout } from "node:process"; -import { arrayBuffer, blob, buffer, json, text } from "node:stream/consumers"; +import * as consumers from "node:stream/consumers"; import { finished as finishedPromise, pipeline as pipelinePromise } from "node:stream/promises"; import { ReadableStream, ReadableStreamBYOBReader, TransformStream, WritableStream } from "node:stream/web"; import { setInterval as every, setTimeout as wait } from "node:timers/promises"; @@ -501,25 +501,18 @@ async function streamPipelineAsyncPromiseOptions() { } async function testConsumers() { - const r = createReadStream("file.txt"); + let consumable!: ReadableStream | Readable | AsyncGenerator; - // $ExpectType string - await text(r); - // $ExpectType unknown - await json(r); - // $ExpectType Buffer || Buffer - await buffer(r); // $ExpectType ArrayBuffer - await arrayBuffer(r); + await consumers.arrayBuffer(consumable); // $ExpectType Blob - await blob(r); - - const iterable: AsyncGenerator = async function*() {}(); - await buffer(iterable); - - const iterator: AsyncIterator = { next: () => iterable.next() }; - // @ts-expect-error - await buffer(iterator); + await consumers.blob(consumable); + // $ExpectType Buffer || Buffer + await consumers.buffer(consumable); + // $ExpectType unknown + await consumers.json(consumable); + // $ExpectType string + await consumers.text(consumable); } // https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 855ca3599a2b29..c9bea45e3a688b 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -5808,7 +5808,7 @@ declare namespace Office { * * * - * + * * *
Office on the web Office on Windows Office on Mac Office on iPad
Excel Compressed, Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed, Pdf Compressed, Pdf Compressed, Pdf Compressed, Pdf
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
* @@ -5843,7 +5843,7 @@ declare namespace Office { * * * - * + * * *
Office on the web Office on Windows Office on Mac Office on iPad
Excel Compressed, Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed, Pdf Compressed, Pdf Compressed, Pdf Compressed, Pdf
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
* diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index dd758d154acebf..56eab7b063109d 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -5756,7 +5756,7 @@ declare namespace Office { * * * - * + * * *
Office on the web Office on Windows Office on Mac Office on iPad
Excel Compressed, Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed, Pdf Compressed, Pdf Compressed, Pdf Compressed, Pdf
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
* @@ -5791,7 +5791,7 @@ declare namespace Office { * * * - * + * * *
Office on the web Office on Windows Office on Mac Office on iPad
Excel Compressed, Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed, Pdf Compressed, Pdf Compressed, Pdf Compressed, Pdf
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
* diff --git a/types/onesignal-cordova-plugin/.eslintrc.json b/types/onesignal-cordova-plugin/.eslintrc.json deleted file mode 100644 index 39d4cc857bbf89..00000000000000 --- a/types/onesignal-cordova-plugin/.eslintrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rules": { - "@definitelytyped/no-const-enum": "off" - } -} diff --git a/types/onesignal-cordova-plugin/.npmignore b/types/onesignal-cordova-plugin/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/onesignal-cordova-plugin/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/onesignal-cordova-plugin/index.d.ts b/types/onesignal-cordova-plugin/index.d.ts deleted file mode 100644 index 4a784a473e13fa..00000000000000 --- a/types/onesignal-cordova-plugin/index.d.ts +++ /dev/null @@ -1,412 +0,0 @@ -interface Window { - plugins: CordovaPlugins; -} - -interface CordovaPlugins { - OneSignal: OneSignalCordovaPlugin.OneSignalCordovaPlugin; -} - -declare namespace OneSignalCordovaPlugin { - interface OneSignalCordovaPlugin { - OSInFocusDisplayOption: { None: 0; InAppAlert: 1; Notification: 2 }; - OSNotificationPermission: { NotDetermined: 0; Authorized: 1; Denied: 2 }; - addEmailSubscriptionObserver( - callback: (change: { from: OSEmailSubscriptionState; to: OSEmailSubscriptionState }) => void, - ): void; - /** - * The passed in function will be fired when a notification permission - * setting changes. - */ - addPermissionObserver(callback: (change: { from: OSPermissionState; to: OSPermissionState }) => void): void; - /** - * The passed in function will be fired when a notification subscription - * property changes. - */ - addSubscriptionObserver( - callback: (change: { from: OSSubscriptionState; to: OSSubscriptionState }) => void, - ): void; - /** - * Add a trigger, may show an In-App Message if its triggers conditions - * were met. - */ - addTrigger(key: string, value: string | number): void; - /** - * Add a key-value Object of triggers, may show an In-App Message if - * its triggers conditions were met. - */ - addTriggers(triggers: Record): void; - /** Clear all notifications sent from OneSignal */ - clearOneSignalNotifications(): void; - /** - * Deletes a single tag that was previously set on a user with sendTag - * or sendTags. Use deleteTags if you need to delete more than one. - */ - deleteTag(key: string): void; - /** - * Deletes one or more tags that were previously set on a user with - * sendTag or sendTags. - */ - deleteTags(keys: string[]): void; - enableNotificationsWhenActive(enable: boolean): void; - /** - * By default OneSignal plays the system's default notification sound - * when the device's notification system volume is turned on. You may - * also set custom sounds on notifications. Passing false means that the - * device will only vibrate unless the device is set to a total silent - * mode. - */ - enableSound(enable: boolean): void; - /** - * By default OneSignal always vibrates the device when a notification - * is displayed unless the device is in a total silent mode. Passing - * false means that the device will only vibrate lightly when the - * device is in it's vibrate only mode. - */ - enableVibrate(enable: boolean): void; - getIds(IdsReceivedCallBack: (id: { userId: string; pushToken: string }) => void): void; - /** - * Get the current notification and permission state. Returns an object - * of OSPermissionSubscriptionState type described below. - */ - getPermissionSubscriptionState(callback: (status: OSPermissionSubscriptionState) => void): void; - /** - * Retrieve a list of tags that have been set on the user from the - * OneSignal server. - */ - getTags(callback: (tags: any) => void): void; - /** Gets a trigger value for a provided trigger key. */ - getTriggerValueForKey(key: string, callback: (value: any) => void): void; - /** - * Sets a In-App Message clicked handler. The instance will be called - * when an In-App Message action is tapped on. - */ - handleInAppMessageClicked(handler: (action: OSNotificationAction) => void): void; - /** - * If your app implements logout functionality, you can call logoutEmail - * to dissociate the email from the device: - */ - logoutEmail(onSuccess: (success: any) => void, onFailure: (error: any) => void): void; - /** - * Allows you to temporarily pause all In-App Messages. You may want to - * do this while the user is watching a video playing a match in your - * game to make sure they don't get interrupted at a bad time. - */ - pauseInAppMessages(pause: boolean): void; - /** - * Allows you to send notifications from user to user or schedule ones - * in the future to be delivered to the current device. - */ - postNotification( - notificationObj: Partial, - onSuccess: (json: any) => void, - onFailure: (json: any) => void, - ): void; - /** - * Prompt the user for notification permissions. Callback fires as soon - * as the user accepts or declines notifications. - */ - promptForPushNotificationsWithUserResponse(callback: (accepted: boolean) => void): void; - /** - * Prompts the user for location permissions. This allows for - * geotagging so you can send notifications to users based on location. - */ - promptLocation(): void; - /** - * If your application is set to require the user's privacy consent, - * you can provide this consent using this method. Until you call - * provideUserConsent(true), the SDK will not fully initialize and will - * not send any data to OneSignal. - */ - provideUserConsent(granted: boolean): void; - registerForPushNotifications(): void; - /** - * If your user logs out of your app and you would like to disassociate - * their custom user ID from your system with their OneSignal user ID, - * you will want to call this method. - */ - removeExternalUserId(): void; - /** - * Removes a single trigger for the given key, may show an In-App - * Message if its triggers conditions were met. - */ - removeTriggerForKey(key: string): void; - /** - * Removes a list of triggers based on a collection of keys, may show - * an In-App Message if its triggers conditions were met. - */ - removeTriggersForKeys(keys: string[]): void; - /** - * Tag a user based on an app event of your choosing so later you can - * create segments in Segments to target these users. Use sendTags if - * you need to set more than one tag on a user at a time. - */ - sendTag(key: string, value: string): void; - /** - * Tag a user based on an app event of your choosing so later you can - * create segments in Segments to target these users. - */ - sendTags(tags: { [key: string]: string }): void; - /** Allows you to set the user's email address with the OneSignal SDK */ - setEmail(email: string): void; - /** - * If you have a backend server, we strongly recommend using Identity - * Verification with your users. Your backend can generate an email - * authentication token and send it to your app. The following code - * also includes callbacks: - */ - setEmail( - email: string, - emailAuthToken: string, - onSuccess: (success: any) => void, - onFailure: (error: any) => void, - ): void; - /** - * If your system assigns unique identifiers to users, it can be - * annoying to have to also remember their OneSignal user ID's as well. - * To make things easier, OneSignal now allows you to set an - * external_id for your users. Simply call this method, pass in your - * custom user ID (as a string), and from now on when you send a push - * notification, you can use include_external_user_ids instead of - * include_player_ids. - */ - setExternalUserId(userId: string): void; - setInFocusDisplaying(displayType: OSDisplayType): void; - setLocationShared(shared: any): void; - /** - * Enable logging to help debug if you run into an issue setting up - * OneSignal. - */ - setLogLevel(logLevel: { logLevel: OSLogLevel; visualLevel: OSLogLevel }): void; - /** - * Allows you to delay the initialization of the SDK until the user - * provides privacy consent. The SDK will not be fully initialized - * until the provideUserConsent(true) method is called. If you set this - * to be true, the SDK will not fully initialize until consent is - * provided. You can still call OneSignal methods, but nothing will - * happen, and the user will not be registered for push notifications. - */ - setRequiresUserPrivacyConsent(required: boolean): void; - /** - * You can call this method with false to opt users out of receiving - * all notifications through OneSignal. You can pass true later to opt - * users back into notifications. This unsubscribes the user from - * OneSignal, but the device will still show as subscribed to push. - * This method is helpful if you need to unsubscribe users momentarily - * or provide the option in a "settings" page. - */ - setSubscription(enable: boolean): void; - /** - * Starts initialization of OneSignal, call this from the deviceready - * event. - */ - startInit(appId: string, googleProjectNumber?: string): OneSignalBuilder; - syncHashedEmail(email: string): void; - /** - * Accepts a callback, which returns a boolean variable indicating if - * the user has given privacy consent yet. - */ - userProvidedPrivacyConsent(callback: (providedConsent: boolean) => void): void; - } - - interface OneSignalBuilder { - endInit(): void; - handleNotificationOpened(callback: (json: OSNotificationOpenedResult) => void): OneSignalBuilder; - handleNotificationReceived(callback: (json: OSNotification) => void): OneSignalBuilder; - inFocusDisplaying(displayOption: OSDisplayType): OneSignalBuilder; - iOSSettings(settings: { - kOSSettingsKeyAutoPrompt: boolean; - kOSSettingsKeyInAppLaunchURL: boolean; - }): OneSignalBuilder; - } - - interface OSNotification { - isAppInFocus: boolean; - shown: boolean; - androidNotificationId?: number | undefined; - payload: OSNotificationPayload; - displayType: OSDisplayType; - groupedNotifications?: OSNotificationPayload[] | undefined; - app_id?: string | undefined; - contents: any; - headings?: any; - isIos?: boolean | undefined; - isAndroid?: boolean | undefined; - isWP?: boolean | undefined; - isWP_WNS?: boolean | undefined; - isAdm?: boolean | undefined; - isChrome?: boolean | undefined; - isChromeWeb?: boolean | undefined; - isSafari?: boolean | undefined; - isAnyWeb?: boolean | undefined; - included_segments?: string[] | undefined; - excluded_segments?: string[] | undefined; - include_player_ids?: string[] | undefined; - include_ios_tokens?: string[] | undefined; - include_android_reg_ids?: string[] | undefined; - include_wp_uris?: string[] | undefined; - include_wp_wns_uris?: string[] | undefined; - include_amazon_reg_ids?: string[] | undefined; - include_chrome_reg_ids?: string[] | undefined; - include_chrome_web_reg_ids?: string[] | undefined; - app_ids?: string[] | undefined; - tags?: any[] | undefined; - ios_badgeType?: string | undefined; - ios_badgeCount?: number | undefined; - ios_sound?: string | undefined; - android_sound?: string | undefined; - adm_sound?: string | undefined; - wp_sound?: string | undefined; - wp_wns_sound?: string | undefined; - data?: any; - buttons?: any; - small_icon?: string | undefined; - large_icon?: string | undefined; - big_picture?: string | undefined; - adm_small_icon?: string | undefined; - adm_large_icon?: string | undefined; - adm_big_picture?: string | undefined; - chrome_icon?: string | undefined; - chrome_big_picture?: string | undefined; - chrome_web_icon?: string | undefined; - firefox_icon?: string | undefined; - url?: string | undefined; - send_after?: string | undefined; - delayed_option?: string | undefined; - delivery_time_of_day?: string | undefined; - android_led_color?: string | undefined; - android_accent_color?: string | undefined; - android_visibility?: number | undefined; - content_available?: boolean | undefined; - amazon_background_data?: boolean | undefined; - template_id?: string | undefined; - android_group?: string | undefined; - android_group_message?: any; - adm_group?: string | undefined; - adm_group_message?: any; - ttl?: number | undefined; - priority?: number | undefined; - ios_category?: string | undefined; - } - - interface OSNotificationPayload { - notificationID: string; - title: string; - body: string; - additionalData?: any; - smallIcon?: string | undefined; - largeIcon?: string | undefined; - bigPicture?: string | undefined; - smallIconAccentColor?: string | undefined; - launchURL?: string | undefined; - sound: string; - ledColor?: string | undefined; - lockScreenVisibility?: OSLockScreenVisibility | undefined; - groupKey?: string | undefined; - groupMessage?: string | undefined; - actionButtons: OSActionButton[]; - fromProjectNumber?: string | undefined; - backgroundImageLayout?: OSBackgroundImageLayout | undefined; - priority?: number | undefined; - rawPayload: string; - } - - interface OSNotificationAction { - type: "Opened" | "ActionTaken"; - actionID: string; - } - - interface OSEmailSubscriptionState { - emailUserId: string; - emailAddress: string; - } - - interface OSActionButton { - id: string; - text: string; - icon: string; - } - - interface OSPermissionState { - hasPrompted: boolean; - provisional: boolean; - state: OSNotificationPermissionState; - status: OSNotificationPermission; - } - - interface OSSubscriptionState { - subscribed: boolean; - userSubscriptionSetting: boolean; - userId: string; - pushToken: string; - } - - interface OSPermissionSubscriptionState { - emailSubscriptionStatus: OSEmailSubscriptionState; - permissionStatus: OSPermissionState; - subscriptionStatus: OSSubscriptionState; - } - - interface OSBackgroundImageLayout { - image: string; - titleTextColor: string; - bodyTextColor: string; - } - - interface OSNotificationOpenedResult { - action: { - type: OSActionType; - actionID?: string | undefined; - }; - notification: OSNotification; - } - - const enum OSLockScreenVisibility { - Public = 1, - Private = 0, - Secret = -1, - } - - const enum OSDisplayType { - None = 0, - InAppAlert = 1, - Notification = 2, - } - - const enum OSActionType { - Opened = 0, - ActionTake = 1, - } - - const enum OSInFocusDisplayOption { - None = 0, - InAppAlert = 1, - Notification = 2, - } - - /** - * iOS only - */ - const enum OSNotificationPermission { - NotDetermined = 0, - Denied = 1, - Authorized = 2, - } - - /** - * Android only - */ - const enum OSNotificationPermissionState { - Authorized = 1, - Denied = 2, - } - - const enum OSLogLevel { - None, - Fatal, - Errors, - Warnings, - Info, - Debug, - Verbose, - } -} diff --git a/types/onesignal-cordova-plugin/onesignal-cordova-plugin-tests.ts b/types/onesignal-cordova-plugin/onesignal-cordova-plugin-tests.ts deleted file mode 100644 index bda08e5691e85d..00000000000000 --- a/types/onesignal-cordova-plugin/onesignal-cordova-plugin-tests.ts +++ /dev/null @@ -1,67 +0,0 @@ -window.plugins.OneSignal - .startInit("YOUR_APPID") - .handleNotificationReceived((jsonData) => { - console.log("Notification received:\n" + JSON.stringify(jsonData)); - }) - .handleNotificationOpened((jsonData) => { - console.log("Notification opened:\n" + JSON.stringify(jsonData)); - }) - .inFocusDisplaying(OneSignalCordovaPlugin.OSDisplayType.Notification) - .iOSSettings({ - kOSSettingsKeyAutoPrompt: true, - kOSSettingsKeyInAppLaunchURL: false, - }) - .endInit(); - -window.plugins.OneSignal.promptForPushNotificationsWithUserResponse((accepted) => { - console.log("User accepted notifications: " + accepted); -}); - -window.plugins.OneSignal.addPermissionObserver((state) => { - console.log("Notification permission state changed: " + JSON.stringify(state)); -}); - -window.plugins.OneSignal.addSubscriptionObserver((state) => { - if (!state.to.subscribed) { - console.log("Subscribed for OneSignal push notifications!"); - } - console.log("Push Subscription state changed: " + JSON.stringify(state)); -}); - -window.plugins.OneSignal.getTags((tags) => { - console.log("Tags Received: " + JSON.stringify(tags)); -}); - -window.plugins.OneSignal.sendTag("key", "value"); - -window.plugins.OneSignal.deleteTag("key"); - -window.plugins.OneSignal.sendTags({ key1: "value", key2: "value2" }); - -window.plugins.OneSignal.deleteTags(["key1", "key2"]); - -window.plugins.OneSignal.promptLocation(); - -window.plugins.OneSignal.syncHashedEmail("John.Smith@example.com"); - -window.plugins.OneSignal.getIds((ids) => { - const notificationObj = { - contents: { en: "message body" }, - include_player_ids: [ids.userId], - }; - window.plugins.OneSignal.postNotification(notificationObj, (successResponse) => { - console.log("Notification Post Success:", successResponse); - }, (failedResponse) => { - console.log("Notification Post Failed: ", failedResponse); - }); -}); - -window.plugins.OneSignal.clearOneSignalNotifications(); - -window.plugins.OneSignal.setSubscription(false); - -window.plugins.OneSignal.enableVibrate(false); - -window.plugins.OneSignal.enableSound(false); - -window.plugins.OneSignal.setLogLevel({ logLevel: 4, visualLevel: 4 }); diff --git a/types/onesignal-cordova-plugin/package.json b/types/onesignal-cordova-plugin/package.json deleted file mode 100644 index ea2ba1ef2bfaf9..00000000000000 --- a/types/onesignal-cordova-plugin/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "private": true, - "name": "@types/onesignal-cordova-plugin", - "version": "2.6.9999", - "projects": [ - "https://github.com/onesignal/OneSignal-Cordova-SDK#readme" - ], - "devDependencies": { - "@types/onesignal-cordova-plugin": "workspace:." - }, - "owners": [ - { - "name": "David Broder-Rodgers", - "githubUsername": "broder" - }, - { - "name": "Vaclav Novotny", - "githubUsername": "vaclavnovotny" - } - ] -} diff --git a/types/onesignal-cordova-plugin/tsconfig.json b/types/onesignal-cordova-plugin/tsconfig.json deleted file mode 100644 index a1ff8501fc1b2a..00000000000000 --- a/types/onesignal-cordova-plugin/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "onesignal-cordova-plugin-tests.ts" - ] -} diff --git a/types/react-widgets/.eslintrc.json b/types/react-widgets/.eslintrc.json deleted file mode 100644 index 82cbf9cce87fd9..00000000000000 --- a/types/react-widgets/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "rules": { - "@definitelytyped/no-any-union": "off", - "@typescript-eslint/no-empty-interface": "off" - } -} diff --git a/types/react-widgets/.npmignore b/types/react-widgets/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/react-widgets/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/react-widgets/index.d.ts b/types/react-widgets/index.d.ts deleted file mode 100644 index dd878f0c7e20a4..00000000000000 --- a/types/react-widgets/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export import Calendar = require("./lib/Calendar"); -export import Combobox = require("./lib/Combobox"); -export import DateTimePicker = require("./lib/DateTimePicker"); -export import DropdownList = require("./lib/DropdownList"); -export import Multiselect = require("./lib/Multiselect"); -export import NumberPicker = require("./lib/NumberPicker"); -export import SelectList = require("./lib/SelectList"); diff --git a/types/react-widgets/lib/Calendar.d.ts b/types/react-widgets/lib/Calendar.d.ts deleted file mode 100644 index f19f27d54ac37f..00000000000000 --- a/types/react-widgets/lib/Calendar.d.ts +++ /dev/null @@ -1,145 +0,0 @@ -import { ComponentClass } from "react"; -import { AutoFocus, ReactWidgetsCommonProps } from "./CommonProps"; - -declare namespace Calendar { - type CalendarView = "month" | "year" | "decade" | "century"; - - interface CalendarProps extends ReactWidgetsCommonProps, AutoFocus { - /** - * Set the culture of the Calendar, passed to the configured localizer. - */ - culture?: string | undefined; - /** - * The current selected date, should be a Date object or null. - */ - value?: Date | undefined; - /** - * Default value. - */ - defaultValue?: Date | undefined; - /** - * Change event Handler that is called when the value is changed. The handler is called with - * the Date object - */ - onChange?: ((date?: Date) => void) | undefined; - /** - * The native onKeyDown event, called preventDefault will prevent any custom behavior, included keyboard shortcuts. - */ - onKeyDown?: ((event: KeyboardEvent) => void) | undefined; - /** - * Callback fired when the Calendar navigates between views, or forward and backwards in - * time. - */ - onNavigate?: ((date: Date, direction: string, view: string) => void) | undefined; - /** - * A callback fired when the view changes. - */ - onViewChange?: (() => void) | undefined; - /** - * The minimum date that the Calendar can navigate from. - */ - min?: Date | undefined; - /** - * The maximum date that the Calendar can navigate to. - */ - max?: Date | undefined; - /** - * Default current date at which the calendar opens. If none is provided, opens at today's - * date or the value date (if any). - * @default Date() - */ - currentDate?: Date | undefined; - /** - * Change event Handler that is called when the currentDate is changed. The handler is - * called with the currentDate object. - */ - onCurrentDateChange?: ((date?: Date) => void) | undefined; - /** - * Show or hide the Calendar footer. - * @default false - */ - footer?: boolean | undefined; - /** - * Provide a custom component to render the days of the month. - * The Component is provided the following props - * - date: a Date object for the day of the month to render - * - label: a formatted String of the date to render. To adjust the format of the label - * string use the dateFormat prop, listed below. - */ - dayComponent?: React.ElementType | undefined; - /** - * The starting and lowest level view the calendar can navigate down to. - */ - initialView?: "month" | "year" | "decade" | "century" | undefined; - /** - * The highest level view the calendar can navigate up to. This value should be higher than - * initialView - */ - finalView?: "month" | "year" | "decade" | "century" | undefined; - /** - * A formatter for the header button of the month view - */ - headerFormat?: string | ((day: Date) => string) | undefined; - /** - * A formatter for the Calendar footer, formats Today's Date as a string. - */ - footerFormat?: string | ((day: Date) => string) | undefined; - /** - * A formatter calendar days of the week, the default formats each day as a Narrow name: - * "Mo", "Tu", etc. - */ - dayFormat?: string | ((day: Date) => string) | undefined; - /** - * A formatter for day of the month. - */ - dateFormat?: string | ((day: Date) => string) | undefined; - /** - * A formatter for month name. - */ - monthFormat?: string | ((day: Date) => string) | undefined; - /** - * A formatter for the year. - */ - yearFormat?: string | ((day: Date) => string) | undefined; - /** - * A formatter for decade, the default formats the first and last year of the decade like: - * 2000 - 2009. - */ - decadeFormat?: string | ((day: Date) => string) | undefined; - /** - * A formatter for century, the default formats the first and last year of the century like: - * 1900 - 1999. - */ - centuryFormat?: string | ((day: Date) => string) | undefined; - messages?: CalendarMessages | undefined; - /** - * Set a unique starting view - */ - defaultView?: CalendarView | undefined; - /** - * Controls the currently displayed calendar view. Use defaultView to set a unique starting view. - */ - view?: CalendarView | undefined; - /** - * Defines a list of views the Calendar can traverse through, starting with the first in the list to the last. - */ - views?: CalendarView[] | undefined; - } - - interface CalendarMessages { - /** - * Title and screen reader text for the left arrow button. - * @default "navigate back" - */ - moveBack?: string | undefined; - /** - * Title and screen reader text for the right arrow button. - * @default "navigate forward" - */ - moveForward?: string | undefined; - } -} - -interface CalendarClass extends ComponentClass {} -declare var Calendar: CalendarClass; -export = Calendar; diff --git a/types/react-widgets/lib/Combobox.d.ts b/types/react-widgets/lib/Combobox.d.ts deleted file mode 100644 index ff34d243431a4f..00000000000000 --- a/types/react-widgets/lib/Combobox.d.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { ComponentClass } from "react"; -import { AutoFocus, ReactWidgetsCommonDropdownProps } from "./CommonProps"; - -declare namespace Combobox { - interface ComboboxMessages { - /** - * Combobox button text for screen readers - */ - open: string | ((props: ComboboxProps) => string); - /** - * text to display when the data prop array is empty - */ - emptyList: string | ((props: ComboboxProps) => string); - /** - * text to display when the the current filter does not return any results - */ - emptyFilter: string | ((props: ComboboxProps) => string); - } - - interface ComboboxProps extends ReactWidgetsCommonDropdownProps, AutoFocus { - /** - * The current value of the Combobox. This can be an object (such as a member of the data - * array) or a primitive value, hinted to by the valueField. The widget value does not need - * to be in the data, widgets can have values that are not in their list. - */ - value?: any; - /** - * Default value. - */ - defaultValue?: any; - /** - * Called when the value is changed. If the value is one of the data members that item will - * be returned. In the case of a value not being found in the data array the string value of - * the Combobox will be returned. - */ - onChange?: ((value: any) => void) | undefined; - /** - * This handler fires when an item has been selected from the list. It fires before the - * onChange handler, and fires regardless of whether the value has actually changed. - */ - onSelect?: ((value: any) => void) | undefined; - /** - * An array of possible values for the Combobox. If an array of objects is provided you - * should use the valueField and textField props, to specify which object properties - * comprise the value field (such as an id) and the field used to label the item. - */ - data?: any[] | undefined; - /** - * Delay - * @default 500 - */ - delay?: number | undefined; - /** - * A dataItem field name for uniquely identifying items in the data list. A valueField is - * required when the value prop is not itself a dataItem. A valueField is useful when - * specifying the selected item, by its id instead of using the model as the value. When a - * valueField is not provided, the Combobox will use strict equality checks (===) to locate - * the value in the data list. - */ - valueField?: string | undefined; - /** - * Specify which data item field to display in the Combobox and selected item. The - * textField` prop may also also used as to find an item in the list as you type. Providing - * an accessor function allows for computed text values - */ - textField?: string | ((dataItem: any) => string) | undefined; - /** - * This component is used to render each possible item in the Combobox. The default - * component renders the text of the selected item (specified by textfield) - */ - itemComponent?: React.ElementType | undefined; - /** - * An object of props that is passed directly to the underlying input component. - */ - inputProps?: object | undefined; - listComponent?: React.ElementType | string | undefined; - /** - * An object of props that is passed directly to the underlying List component. - */ - listProps?: object | undefined; - /** - * Determines how to group the Combobox. Providing a string will group the data array by - * that property. You can also provide a function which should return the group value. - */ - groupBy?: string | ((dataItem: any) => any) | undefined; - /** - * This component is used to render each option group, when groupBy is specified. By default - * the groupBy value will be used. - */ - groupComponent?: React.ElementType | undefined; - /** - * The same as an input placeholder, only works in browsers that support the placeholder - * attribute for inputs - */ - placeholder?: string | undefined; - /** - * When true the Combobox will suggest, or fill in, values as you type. The suggestions are - * always "startsWith", meaning it will search from the start of the textField property - */ - suggest?: boolean | undefined; - /** - * A Transition component from react-transition-group v2. The provided component will be used - * instead of the default SlideDownTransition for fully customizable animations. - * The transition component is also injected with a dropUp prop indicating the direction it should open. - */ - popupTransition?: React.ElementType | string | undefined; - /** - * Specify a filtering method used to reduce the items in the dropdown as you type. It can - * be used in conjunction with the suggest prop or instead of it. There are a few built-in - * filtering methods that can be specified by passing the String name. You can explicitly - * opt out of filtering by setting filter to false To handle custom filtering techniques - * provide a function that returns true or false for each passed in item (analogous to the - * array.filter builtin) Acceptable values for filter are: false "startsWith" "endsWith" - * "contains" function(String item) - */ - filter?: boolean | string | ((dataItem: any, searchItem: any) => boolean) | undefined; - /** - * Use in conjunction with the filter prop. Filter the list without regard for case. This - * only applies to non function values for filter - */ - caseSensitive?: boolean | undefined; - /** - * Use in conjunction with the filter prop. Start filtering the list only after the value - * has reached a minimum length. - */ - minLength?: number | undefined; - /** - * Whether or not the Combobox is open. When unset (undefined) the Combobox will handle the - * opening and closing internally. The defaultOpen prop can be used to set an initialization - * value for uncontrolled widgets. - */ - open?: boolean | undefined; - /** - * Called fires when the Combobox is about to open or close. onToggle should be used when - * the open prop is set otherwise the widget will never open or close. - */ - onToggle?: ((isOpen: boolean) => void) | undefined; - /** - * Mark whether the widget is in a busy or loading state. If true the widget will display a - * spinner gif, useful when loading data via an ajax call. - */ - busy?: boolean | undefined; - /** - * An optional ReactNode to override the spinner gif element when the busy property - * is set to true. - */ - busySpinner?: React.ReactNode | undefined; - /** - * The speed, in milliseconds, of the dropdown animation. - */ - duration?: number | undefined; - /** - * The HTML name attribute, passed directly to the input element. - */ - name?: string | undefined; - /** - * Object hash containing display text and/or text for screen readers. Use the messages - * object to localize widget text and increase accessibility. - */ - messages?: ComboboxMessages | undefined; - } -} - -interface ComboboxClass extends ComponentClass {} -declare var Combobox: ComboboxClass; -export = Combobox; diff --git a/types/react-widgets/lib/CommonProps.d.ts b/types/react-widgets/lib/CommonProps.d.ts deleted file mode 100644 index 3bccb50aae07a0..00000000000000 --- a/types/react-widgets/lib/CommonProps.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -export interface ReactWidgetsCommonProps { - /** - * Disable the widget, if an Array of values is passed in only those values will be disabled. - * @default false - */ - disabled?: boolean | any[] | undefined; - /** - * Place the widget in a read-only mode, If an Array of values is passed in only those - * values will be read-only. - * @default false - */ - readOnly?: boolean | any[] | undefined; - /** - * Mark whether the SelectList should render right-to-left. This property can also be - * implicitly passed to the widget through a childContext prop (isRtl) this allows higher - * level application components to specify the direction. - * @default false - */ - isRtl?: boolean | undefined; - /** - * Used to label and annotate aria- attributes - */ - id?: string | undefined; -} - -export interface AutoFocus { - /** - * Pass focus to component when it mounts. - */ - autoFocus?: boolean | undefined; -} - -export interface ReactWidgetsCommonDropdownProps extends ReactWidgetsCommonProps { - /** - * Show "drop up" not "drop down" - * @default false - */ - dropUp?: boolean | undefined; -} diff --git a/types/react-widgets/lib/DateTimePicker.d.ts b/types/react-widgets/lib/DateTimePicker.d.ts deleted file mode 100644 index d745a918e3b2f3..00000000000000 --- a/types/react-widgets/lib/DateTimePicker.d.ts +++ /dev/null @@ -1,206 +0,0 @@ -import { ComponentClass, ElementType, FocusEvent, JSX, KeyboardEvent, ReactElement } from "react"; -import { AutoFocus, ReactWidgetsCommonDropdownProps } from "./CommonProps"; - -declare namespace DateTimePicker { - type Open = false | "date" | "time"; - - interface DateTimePickerProps extends ReactWidgetsCommonDropdownProps, AutoFocus { - /** - * Set the culture of the DateTimePicker, passed to the configured localizer. - */ - culture?: string | undefined; - /** - * Whether to show the date picker button. - * @default true - * @deprecated Use `date` instead - */ - calendar?: boolean | undefined; - /** - * Whether to show the time picker button. - * @default true - */ - time?: boolean | undefined; - /** - * A customize the rendering of times but providing a custom component. - */ - timeComponent?: ElementType | string | undefined; - /** - * The minimum Date that can be selected. Min only limits selection, it doesn't constrain - * the date values that can be typed or pasted into the widget. If you need this behavior - * you can constrain values via the onChange handler. - * @default Date(1900, 0, 1) - */ - min?: Date | undefined; - /** - * The maximum Date that can be selected. Max only limits selection, it doesn't constrain - * the date values that can be typed or pasted into the widget. If you need this behavior - * you can constrain values via the onChange handler. - * @default Date(2099, 11, 31) - */ - max?: Date | undefined; - /** - * Default current date at which the calendar opens. If none is provided, opens at today's - * date or the value date (if any). - * @default Date() - */ - currentDate?: Date | undefined; - /** - * Default current date - */ - defaultCurrentDate?: Date | undefined; - /** - * Default value for current date. Useful for suggesting a date when the caldenar opens without keep forcing it once 'value' is set. - */ - date?: boolean | undefined; - /** - * Specify the element used to render the calendar dropdown icon. - */ - dateIcon?: JSX.Element | undefined; - /** - * Specify the element used to render the time list dropdown icon. - */ - timeIcon?: JSX.Element | undefined; - /** - * Change event Handler that is called when the currentDate is changed. The handler is - * called with the currentDate object. - */ - onCurrentDateChange?: ((date?: Date) => void) | undefined; - /** - * A string format used to display the date value. - */ - format?: string | undefined; - /** - * A string format to be used while the date input has focus. Useful for showing a simpler - * format for inputing. - */ - editFormat?: string | undefined; - /** - * A string format used by the time dropdown to render times. - */ - timeFormat?: string | undefined; - /** - * The amount of minutes between each entry in the time list. - */ - step?: number | boolean | undefined; - /** - * Determines how the widget parses the typed date string into a Date object. You can - * provide an array of formats to try, or provide a function that returns a date to handle - * parsing yourself. When parse is unspecified and the format prop is a String parse will - * automatically use that format as its default - */ - parse?: ((str: string) => Date | undefined) | string[] | string | undefined; - /** - * The starting and lowest level view the calendar can navigate down to. - */ - initialView?: "month" | "year" | "decade" | "century" | undefined; - /** - * The highest level view the calendar can navigate up to. This value should be higher than - * initialView. - */ - finalView?: "month" | "year" | "decade" | "century" | undefined; - /** - * The current selected date, should be a Date instance or null. - */ - value?: Date | undefined; - /** - * Default value. - */ - defaultValue?: Date | undefined; - /** - * Change event Handler that is called when the value is changed. The handler is called with - * both the current Date object (or null if it was not parseable), and the second argument - * is a string representation of the date value, formated by the format prop. - */ - onChange?: ((date?: Date, dateStr?: string) => void) | undefined; - /** - * The native onBlur event, called when focus leaves the DateTimePicker entirely. - */ - onBlur?: ((e: FocusEvent) => void) | undefined; - /** - * The native onFocus event, called when focus enters the DateTimePicker. - */ - onFocus?: ((e: FocusEvent) => void) | undefined; - /** - * The native onKeyDown event, called preventDefault will prevent any custom behavior, included keyboard shortcuts. - */ - onKeyDown?: ((event: KeyboardEvent) => void) | undefined; - /** - * The native onKeyPress event, called preventDefault will stop any custom behavior. - */ - onKeyPress?: ((event: KeyboardEvent) => void) | undefined; - /** - * This handler fires when an item has been selected from the list or calendar. It fires - * before the onChange handler, and fires regardless of whether the value has actually - * changed. - */ - onSelect?: ((date?: Date) => void) | undefined; - /** - * Whether or not the DateTimePicker is open. When unset (undefined) the DateTimePicker will - * handle the opening and closing internally. - * @default false - */ - open?: Open | undefined; - /** - * The defaultOpen prop can be used to set an - * initialization value for uncontrolled widgets. - */ - defaultOpen?: Open | undefined; - /** - * Called when the DateTimePicker is about to open or close. onToggle should be used when - * the open prop is set otherwise the widget will never open or close. - */ - onToggle?: ((isOpen: Open) => void) | undefined; - /** - * The speed, in milliseconds, of the either dropdown animation. - */ - duration?: number | undefined; - /** - * Object hash containing display text and/or text for screen readers. Use the messages - * object to localize widget text and increase accessibility. - */ - messages?: DateTimePickerMessages | undefined; - /** - * Text to display in the input when the value is empty. - */ - placeholder?: string | undefined; - /** - * An object of props that is passed directly to the underlying input component. - */ - inputProps?: object | undefined; - /** - * The HTML name attribute, passed directly to the input element. - */ - name?: string | undefined; - /** - * A Transition component from react-transition-group v2. - * The provided component will be used instead of the default SlideDownTransition for fully customizable animations. - * The transition component is also injected with a dropUp prop indicating the direction it should open. - */ - popupTransition?: ElementType | string | undefined; - /** - * Whether the Dropdown should be above the input field. - */ - dropUp?: boolean | undefined; - /** - * Adds a css class to the input container element. - */ - containerClassName?: string | undefined; - } - - interface DateTimePickerMessages { - /** - * Title and screen reader text for the left arrow button. - * @default "Select Date" - */ - dateButton?: string | undefined; - /** - * Title and screen reader text for the right arrow button. - * @default "Select Time" - */ - timeButton?: string | undefined; - } -} - -interface DateTimePickerClass extends ComponentClass {} -declare var DateTimePicker: DateTimePickerClass; -export = DateTimePicker; diff --git a/types/react-widgets/lib/DropdownList.d.ts b/types/react-widgets/lib/DropdownList.d.ts deleted file mode 100644 index 86af248f05b6ab..00000000000000 --- a/types/react-widgets/lib/DropdownList.d.ts +++ /dev/null @@ -1,212 +0,0 @@ -import { ComponentClass } from "react"; -import { AutoFocus, ReactWidgetsCommonDropdownProps } from "./CommonProps"; - -declare namespace DropdownList { - interface DropdownListProps extends ReactWidgetsCommonDropdownProps, AutoFocus { - /** - * Allow to create a new option on the data list. - */ - allowCreate?: boolean | "onFilter" | undefined; - /** - * The current value of the DropdownList. This can be an object (such as a member of the - * data array) or a primitive value, hinted to by the valueField. The widget value does not - * need to be in the data array; widgets can have values that are not in their list. - */ - value?: any; - /** - * Default value. - */ - defaultValue?: any; - /** - * Create event Handler that is called when a new option is added to the data list. - */ - onCreate?: ((value: any) => void) | undefined; - /** - * Change event Handler that is called when the value is changed. - */ - onChange?: ((value: any) => void) | undefined; - /** - * This handler fires when an item has been selected from the list. It fires before the - * onChange handler, and fires regardless of whether the value has actually changed. - */ - onSelect?: ((value: any) => void) | undefined; - /** - * The native onKeyDown event, called preventDefault will prevent any custom behavior, included keyboard shortcuts. - */ - onKeyDown?: ((event: KeyboardEvent) => void) | undefined; - /** - * The native onKeyPress event, called preventDefault will stop any custom behavior. - */ - onKeyPress?: ((event: KeyboardEvent) => void) | undefined; - /** - * Provide an array of possible values for the DropdownList. If an array of objects is - * provided you should use the valueField and textField props, to specify which object - * properties comprise the value field (such as an id) and the field used to label the item. - */ - data?: any[] | undefined; - /** - * Delay - * @default 250 - */ - delay?: number | undefined; - /** - * Change the opening direction of the popup - */ - dropUp?: boolean | undefined; - /** - * A dataItem field name for uniquely identifying items in the data list. A valueField is - * required when the value prop is not itself a dataItem. A valueField is useful when - * specifying the selected item, by its id instead of using the model as the value. - * When a valueField is not provided, the DropdownList will use strict equality checks (===) - * to locate the value in the data list. - */ - valueField?: string | undefined; - /** - * Specify which data item field to display in the DropdownList and selected item. - * ThetextFieldprop may also also used as to find an item in the list as you type. Providing - * an accessor function allows for computed text values - */ - textField?: string | ((dataItem: any) => string) | undefined; - /** - * This component is used to render the selected value of the DropdownList. The default - * component renders the text of the selected item (specified by textfield) - */ - valueComponent?: React.ElementType | undefined; - /** - * This component is used to render each possible item in the DropdownList. The default - * component renders the text of the selected item (specified by textfield) - */ - itemComponent?: React.ElementType | string | undefined; - /** - * Determines how to group the DropdownList. Providing a string will group the data array by - * that property. You can also provide a function which should return the group value. - */ - groupBy?: string | ((dataItem: any) => any) | undefined; - /** - * This component is used to render each option group, when groupBy is specified. By default - * the groupBy value will be used. - */ - groupComponent?: React.ElementType | undefined; - /** - * Text to display when the value is empty. - */ - placeholder?: string | undefined; - /** - * The string value of the current search being typed into the DropdownList. When unset - * (undefined) the DropdownList will handle the filtering internally. The defaultSearchTerm - * prop can be used to set an initialization value for uncontrolled widgets. searchTerm is - * only relevant when the filter prop is set. - */ - searchTerm?: string | undefined; - /** - * Called when the value of the filter input changes either from typing or a pasted value. - * onSearch should be used when the searchTerm prop is set. - */ - onSearch?: ((searchTerm: string) => void) | undefined; - /** - * Whether or not the DropdownList is open. When unset (undefined) the DropdownList will - * handle the opening and closing internally. - */ - open?: boolean | undefined; - /** - * The defaultOpen prop can be used to set an - * initialization value for uncontrolled widgets. - */ - defaultOpen?: boolean | undefined; - /** - * Called when the DropdownList is about to open or close. onToggle should be used when the - * open prop is set otherwise the widget open buttons won't work. - */ - onToggle?: ((isOpen: boolean) => void) | undefined; - /** - * Specify a filtering method used to reduce the items in the dropdown as you type. - * There are a few built-in filtering methods that can be specified by passing the String name. - * To handle custom filtering techniques provide a function that returns true or false - * for each passed in item (analogous to the array.filter builtin) - */ - filter?: false | "startsWith" | "endsWith" | "contains" | ((dataItem: any, str: string) => boolean) | undefined; - /** - * Use in conjunction with the filter prop. Filter the list without regard for case. This - * only applies to non function values for filter - * @default false - */ - caseSensitive?: boolean | undefined; - /** - * Use in conjunction with the filter prop. Start filtering the list only after the value - * has reached a minimum length. - * @default 1 - */ - minLength?: number | undefined; - /** - * Mark whether the widget is in a busy or loading state. If true the widget will display a - * spinner gif, useful when loading data via an ajax call. - * @default false - */ - busy?: boolean | undefined; - /** - * An optional ReactNode to override the spinner gif element when the busy property - * is set to true. - */ - busySpinner?: React.ReactNode | undefined; - /** - * The speed, in milliseconds, of the dropdown animation. - * @default 250 - */ - duration?: number | undefined; - /** - * Object hash containing display text and/or text for screen readers. Use the messages - * object to localize widget text and increase accessibility. - */ - messages?: DropdownListMessages | undefined; - listComponent?: React.ElementType | string | undefined; - /** - * An object of props that is passed directly to the underlying List component. - */ - listProps?: object | undefined; - /** - * The HTML name attribute used to group checkboxes and radio buttons together. - */ - name?: string | undefined; - /** - * Whether or not the SelectList allows multiple selection or not. - * when false the SelectList will render as a list of radio buttons, and checkboxes when true. - */ - multiple?: boolean | undefined; - - /** - * Adds a css class to the input container element. - */ - containerClassName?: string | undefined; - } - - interface DropdownListMessages { - /** - * Dropdown button text for screen readers. - * @default "Open Dropdown" - */ - open?: string | ((props: DropdownListProps) => string) | undefined; - /** - * The placeholder text for the filter input. - */ - filterPlaceholder?: string | ((props: DropdownListProps) => string) | undefined; - /** - * Text to display when the data prop array is empty. - * @default "There are no items in this list" - */ - emptyList?: string | ((props: DropdownListProps) => string) | undefined; - /** - * Text to display when the the current filter does not return any results. - * @default "The filter returned no results" - */ - emptyFilter?: string | ((props: DropdownListProps) => string) | undefined; - /** - * Text to display for the create option - * @default "Create option {text}" - */ - createOption?: string | ((props: DropdownListProps) => string) | undefined; - } -} - -interface DropdownListClass extends ComponentClass {} -declare var DropdownList: DropdownListClass; -export = DropdownList; diff --git a/types/react-widgets/lib/Multiselect.d.ts b/types/react-widgets/lib/Multiselect.d.ts deleted file mode 100644 index c69870de7de09e..00000000000000 --- a/types/react-widgets/lib/Multiselect.d.ts +++ /dev/null @@ -1,226 +0,0 @@ -import { ComponentClass } from "react"; -import { AutoFocus, ReactWidgetsCommonDropdownProps } from "./CommonProps"; - -declare namespace Multiselect { - interface MultiselectProps extends ReactWidgetsCommonDropdownProps, AutoFocus { - /** - * Enables the list option creation UI. onFilter will only the UI when actively filtering for a list item. - * @default 'onFilter' - */ - allowCreate?: boolean | "onFilter" | undefined; - /** - * The current values of the Multiselect. The value should can null, or an array of - * valueField values, or an array of objects (such as a few items in the data array) - */ - value?: any[] | undefined; - /** - * Default Value. - */ - defaultValue?: any[] | undefined; - /** - * Change event Handler that is called when the value is changed. The handler is called with - * an array of values. - */ - onChange?: - | (( - dataItems: any[], - metadata: { - dataItem: any; - action: "insert" | "remove"; - originalEvent?: any; - lastValue?: any[] | undefined; - searchTerm?: string | undefined; - }, - ) => void) - | undefined; - /** - * This handler fires when an item has been selected from the list. It fires before the - * onChange handler, and fires regardless of whether the value has actually changed - */ - onSelect?: - | (( - value: any, - metadata: { - originalEvent: any; - }, - ) => void) - | undefined; - /** - * This handler fires when the user chooses to create a new tag, not in the data list. It is - * up to the widget parent to implement creation logic, a common implementation is shown - * below, where the new tag is selected and added to the data list. - */ - onCreate?: ((searchTerm: string) => void) | undefined; - /** - * Provide an array of possible values for the Multiselect. If an array of objects is - * provided you should use the valueField and textField props, to specify which object - * properties comprise the value field (such as an id) and the field used to label the item. - */ - data?: any[] | undefined; - /** - * A dataItem field name for uniquely identifying items in the data list. A valueField is - * required when the value prop is not itself a dataItem. A valueField is useful when - * specifying the selected item, by its id instead of using the model as the value. - * When a valueField is not provided, the Multiselect will use strict equality checks (===) - * to locate the value in the data list. - */ - valueField?: string | undefined; - /** - * Specify which data item field to display in the Multiselect and selected item. The - * textField prop may also also used as to find an item in the list as you type. Providing - * an accessor function allows for computed text values. - */ - textField?: string | ((dataItem: any) => string) | undefined; - /** - * This component is used to render each selected item. The default component renders the - * text of the selected item (specified by textfield). - */ - tagComponent?: React.ElementType | string | undefined; - /** - * An object of props that is passed directly to the underlying input component. - */ - inputProps?: object | undefined; - /** - * This component is used to render each possible item in the list. The default component - * renders the text of the selected item (specified by textfield). - */ - itemComponent?: React.ElementType | undefined; - /** - * Determines how to group the Multiselect values. Providing a string will group the data - * array by that property. You can also provide a 'function' which should return the group - * value. - */ - groupBy?: string | ((dataItem: any) => any) | undefined; - /** - * This component is used to render each option group, when groupBy is specified. By default - * the groupBy value will be used. - */ - groupComponent?: React.ElementType | undefined; - /** - * The same as an input placeholder, only works in browsers that support the placeholder - * attribute for inputs - */ - placeholder?: string | undefined; - /** - * The string value of the current search being typed into the Multiselect. When unset - * (undefined) the Multiselect will handle the filtering internally. The defaultSearchTerm - * prop can be used to set an initialization value for uncontrolled widgets. - */ - searchTerm?: string | undefined; - /** - * Called when the value of the text box changes either from typing or a pasted value. - * onSearch should be used when the searchTerm prop is set. - */ - onSearch?: - | (( - searchTerm: string, - metadata: { - action: "clear" | "input"; - lastSearchTerm?: string | undefined; - originalEvent?: any; - }, - ) => void) - | undefined; - /** - * Whether or not the Multiselect is open. When unset (undefined) the Multiselect will - * handle the opening and closing internally. The defaultOpen prop can be used to set an - * initialization value for uncontrolled widgets. - */ - open?: boolean | undefined; - /** - * Called when the Multiselect is about to open or close. onToggle should be used when the - * open prop is set otherwise the widget will never open or close. - */ - onToggle?: ((isOpen: boolean) => void) | undefined; - /** - * Specify a filtering method used to reduce the items in the dropdown as you type. There - * are a few built-in filtering methods that can be specified by passing the String name. - * You can explicitly opt out of filtering by setting filter to false. To handle custom - * filtering techniques provide a function that returns true or false for each passed in - * item (analogous to the array.filter builtin) - * @default startsWith - */ - filter?: - | false - | "startsWith" - | "endsWith" - | "contains" - | ((dataItem: any, searchTerm: string) => boolean) - | undefined; - /** - * Use in conjunction with the filter prop. Filter the list without regard for case. This - * only applies to non function values for filter. - * @default false - */ - caseSensitive?: boolean | undefined; - /** - * Use in conjunction with the filter prop. Start filtering the list only after the value - * has reached a minimum length. - * @default 1 - */ - minLength?: number | undefined; - /** - * mark whether the widget is in a busy or loading state. If true the widget will display a - * spinner gif, useful when loading data via an ajax call. - * @default false - */ - busy?: boolean | undefined; - /** - * The speed, in milliseconds, of the dropdown animation. - * @default 250 - */ - duration?: number | undefined; - /** - * Object hash containing display text and/or text for screen readers. Use the messages - * object to localize widget text and increase accessibility. - */ - messages?: MultiselectMessages | undefined; - /** - * @default List - */ - listComponent?: React.ElementType | string | undefined; - /** - * An object of props that is passed directly to the underlying List component. - */ - listProps?: object | undefined; - /** - * A Transition component from react-transition-group v2. - * The provided component will be used instead of the default SlideDownTransition for fully customizable animations. - * The transition component is also injected with a dropUp prop indicating the direction it should open. - */ - popupTransition?: React.ElementType | string | undefined; - - /** - * Adds a css class to the input container element. - */ - containerClassName?: string | undefined; - } - - interface MultiselectMessages { - open?: string | ((props: MultiselectProps) => string) | undefined; - createOption?: string | ((props: MultiselectProps) => string) | undefined; - tagsLabel?: string | ((props: MultiselectProps) => string) | undefined; - selectedItems?: string | ((props: MultiselectProps) => string) | undefined; - noneSelected?: string | ((props: MultiselectProps) => string) | undefined; - removeLabel?: string | ((props: MultiselectProps) => string) | undefined; - /** - * The text label for creating new tags. - * @default "(create new tag)" - */ - createNew?: string | ((props: MultiselectProps) => string) | undefined; - /** - * Text to display when the data prop array is empty. - * @default "There are no items in this list" - */ - emptyList?: string | ((props: MultiselectProps) => string) | undefined; - /** - * Text to display when the the current filter does not return any results. - * @default "The filter returned no results" - */ - emptyFilter?: string | ((props: MultiselectProps) => string) | undefined; - } -} - -interface MultiselectClass extends ComponentClass {} -declare var Multiselect: MultiselectClass; -export = Multiselect; diff --git a/types/react-widgets/lib/NumberPicker.d.ts b/types/react-widgets/lib/NumberPicker.d.ts deleted file mode 100644 index 947ea0ba19238c..00000000000000 --- a/types/react-widgets/lib/NumberPicker.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { ComponentClass } from "react"; -import { AutoFocus, ReactWidgetsCommonProps } from "./CommonProps"; - -declare namespace NumberPicker { - interface NumberPickerProps extends ReactWidgetsCommonProps, AutoFocus { - /** - * Set the culture of the NumberPicker, passed to the configured localizer. - */ - culture?: string | undefined; - /** - * An object of props that is passed directly to the underlying input component. - */ - inputProps?: object | undefined; - /** - * The current value of the NumberPicker. - */ - value?: number | undefined; - /** - * Default Value. - */ - defaultValue?: number | undefined; - /** - * Change event Handler that is called when the value is changed. The handler is called with - * the current numeric value or null. - */ - onChange?: ((value?: number) => void) | undefined; - /** - * A format string used to display the number value. Localizer dependent, read localization - * for more info. - * @see http://jquense.github.io/react-widgets/docs/#i18n - */ - format?: any; - /** - * Determines how the NumberPicker parses a number from the localized string representation. - * You can also provide a parser Function to pair with a custom format. - */ - parse?: string[] | ((str: string, culture: string) => number) | undefined; - /** - * The minimum number that the NumberPicker value. - * @default -Infinity - */ - min?: number | undefined; - /** - * The maximum number that the NumberPicker value. - * @default Infinity - */ - max?: number | undefined; - /** - * Amount to increase or decrease value when using the spinner buttons. - * @default 1 - */ - step?: number | undefined; - /** - * Specify how precise the value should be when typing, incrementing, or decrementing the - * value. When empty, precision is parsed from the current format and culture. - */ - precision?: number | undefined; - /** - * Object hash containing display text and/or text for screen readers. Use the messages - * object to localize widget text and increase accessibility. - */ - messages?: NumberPickerMessages | undefined; - /** - * The HTML name attribute, passed directly to the input element. - */ - name?: string | undefined; - /** - * The native onKeyDown event, called preventDefault will prevent any custom behavior, included keyboard shortcuts. - */ - onKeyDown?: ((event: KeyboardEvent) => void) | undefined; - /** - * The native onKeyPress event, called preventDefault will stop any custom behavior. - */ - onKeyPress?: ((event: KeyboardEvent) => void) | undefined; - /** - * Controls the visibility of the NumberPicker popup. Use defaultOpen to set an initial value for uncontrolled widgets. - * @default false - */ - open?: boolean | undefined; - /** - * Text to display in the input when the value is empty. - */ - placeholder?: string | undefined; - } - - interface NumberPickerMessages { - /** - * Number picker spinner up button text for screen readers. - * @default "increment value" - */ - increment?: string | undefined; - /** - * Number picker spinner down button text for screen readers. - * @default "decrement value" - */ - decrement?: string | undefined; - } -} - -interface NumberPickerClass extends ComponentClass {} -declare var NumberPicker: NumberPickerClass; -export = NumberPicker; diff --git a/types/react-widgets/lib/SelectList.d.ts b/types/react-widgets/lib/SelectList.d.ts deleted file mode 100644 index c71e7b716c9c25..00000000000000 --- a/types/react-widgets/lib/SelectList.d.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { ComponentClass } from "react"; -import { AutoFocus, ReactWidgetsCommonProps } from "./CommonProps"; - -declare namespace SelectList { - interface SelectListProps extends ReactWidgetsCommonProps, AutoFocus { - /** - * The current value or values of the SelectList. This can be an object (such as a member of - * the data array) or a primitive value, hinted to by the valueField. The widget value does - * not need to be in the data array; widgets can have values that are not in their list. - */ - value?: any | any[] | undefined; - /** - * Default Value. - */ - defaultValue?: any | any[] | undefined; - /** - * Change event handler that is called when the value is changed. values will be an array - * when multiple prop is set. - */ - onChange?: ((values: any | any[]) => void) | undefined; - /** - * Provide an array of possible values for the SelectList. If an array of objects is - * provided you should use the valueField and textField props, to specify which object - * properties comprise the value field (such as an id) and the field used to label the item. - */ - data?: any[] | undefined; - /** - * Delay - * @default 250 - */ - delay?: number | undefined; - /** - * A dataItem field name for uniquely identifying items in the data list. A valueField is - * required when the value prop is not itself a dataItem. A valueField is useful when - * specifying the selected item, by its id instead of using the model as the value. - * When a valueField is not provided, the SelectList will use strict equality checks (===) - * to locate the value in the data list. - */ - valueField?: string | undefined; - /** - * Specify which data item field to display in the SelectList and selected item. The - * textField prop may also also used as to find an item in the list as you type. Providing - * an accessor function allows for computed text values. - */ - textField?: string | ((dataItem: any) => string) | undefined; - /** - * Whether or not the SelectList allows multiple selection or not. when false the SelectList - * will render as a list of radio buttons, and checkboxes when true. - */ - multiple?: boolean | undefined; - /** - * This component is used to render each item in the SelectList. The default component - * renders the text of the selected item (specified by textfield) - */ - itemComponent?: React.ElementType | undefined; - /** - * Determines how to group the SelectList dropdown list. Providing a string will group the - * data array by that property. You can also provide a 'function' which should return the - * group value. - */ - groupBy?: string | ((dataItem: any) => any) | undefined; - /** - * This component is used to render each option group, when groupBy is specified. By default - * the groupBy value will be used. - */ - groupComponent?: React.ElementType | undefined; - /** - * The native onKeyDown event, called preventDefault will prevent any custom behavior, included keyboard shortcuts. - */ - onKeyDown?: ((event: KeyboardEvent) => void) | undefined; - /** - * The native onKeyPress event, called preventDefault will stop any custom behavior. - */ - onKeyPress?: ((event: KeyboardEvent) => void) | undefined; - /** - * A handler called when focus shifts on the SelectList. Internally this is used to ensure - * the focused item is in view. If you want to define your own "scrollTo" behavior or just - * disable the default one specify an onMove handler. The handler is called with the - * relevant DOM nodes needed to implement scroll behavior: the list element, the element - * that is currently focused, and a focused value. - */ - onMove?: ((list: HTMLElement, focusedNode: HTMLElement, focusedItem: any) => void) | undefined; - /** - * Mark whether the widget is in a busy or loading state. If true the widget will display a - * spinner gif, useful when loading data via an ajax call. - * @default false - */ - busy?: boolean | undefined; - /** - * Object hash containing display text and/or text for screen readers. Use the messages - * object to localize widget text and increase accessibility. - */ - messages?: SelectListMessages | undefined; - /** - * @default List - */ - listComponent?: React.ElementType | string | undefined; - /** - * An object of props that is passed directly to the underlying List component. - */ - listProps?: object | undefined; - /** - * The HTML name attribute used to group checkboxes and radio buttons together. - */ - name?: string | undefined; - /** - * The HTML tabindex attribute, controls the order in which focus moves via the TAB key - */ - tabIndex?: number | undefined; - } - interface SelectListMessages { - /** - * @default "There are no items in this list" - */ - emptyList?: string | ((props: SelectListProps) => string) | undefined; - } -} - -interface SelectListClass extends ComponentClass {} -declare var SelectList: SelectListClass; -export = SelectList; diff --git a/types/react-widgets/package.json b/types/react-widgets/package.json deleted file mode 100644 index 3472b0fd9f9a93..00000000000000 --- a/types/react-widgets/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "private": true, - "name": "@types/react-widgets", - "version": "4.4.9999", - "projects": [ - "https://github.com/jquense/react-widgets" - ], - "dependencies": { - "@types/react": "*" - }, - "devDependencies": { - "@types/react-dom": "*", - "@types/react-widgets": "workspace:." - }, - "owners": [ - { - "name": "Rogier Schouten", - "githubUsername": "rogierschouten" - }, - { - "name": "Balázs Sándor", - "githubUsername": "sanyatuning" - }, - { - "name": "Frode Hansen", - "githubUsername": "frodehansen2" - }, - { - "name": "Andrew Makarov", - "githubUsername": "r3nya" - }, - { - "name": "Maxime Billemaz", - "githubUsername": "MBillemaz" - }, - { - "name": "Georg Steinmetz", - "githubUsername": "georg94" - }, - { - "name": "Troy Zarger", - "githubUsername": "tzarger" - }, - { - "name": "Siya Mzam ", - "githubUsername": "vegtelenseg" - }, - { - "name": "Cale Bergh", - "githubUsername": "calebergh" - }, - { - "name": "Ryan McKeel", - "githubUsername": "rmckeel" - }, - { - "name": "Jan Kalfus", - "githubUsername": "jankalfus" - } - ] -} diff --git a/types/react-widgets/react-widgets-tests.tsx b/types/react-widgets/react-widgets-tests.tsx deleted file mode 100644 index 304127ee88a0b2..00000000000000 --- a/types/react-widgets/react-widgets-tests.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import * as React from "react"; -import * as ReactDOM from "react-dom"; - -import { Calendar, Combobox, DateTimePicker, DropdownList, Multiselect, NumberPicker, SelectList } from "react-widgets"; -import * as CalendarDefault from "react-widgets/lib/Calendar"; -import * as ComboboxDefault from "react-widgets/lib/Combobox"; -import * as DateTimePickerDefault from "react-widgets/lib/DateTimePicker"; -import * as DropdownListDefault from "react-widgets/lib/DropdownList"; -import * as MultiselectDefault from "react-widgets/lib/Multiselect"; -import * as NumberPickerDefault from "react-widgets/lib/NumberPicker"; -import * as SelectListDefault from "react-widgets/lib/SelectList"; -/* tslint:disable:no-duplicate-imports */ -import { CalendarMessages, CalendarProps, CalendarView } from "react-widgets/lib/Calendar"; -import { ComboboxMessages, ComboboxProps } from "react-widgets/lib/Combobox"; -import { DateTimePickerMessages, DateTimePickerProps } from "react-widgets/lib/DateTimePicker"; -import { DropdownListMessages, DropdownListProps } from "react-widgets/lib/DropdownList"; -import { MultiselectMessages, MultiselectProps } from "react-widgets/lib/Multiselect"; -import { NumberPickerMessages, NumberPickerProps } from "react-widgets/lib/NumberPicker"; -import { SelectListMessages, SelectListProps } from "react-widgets/lib/SelectList"; -/* tslint:enable:no-duplicate-imports */ - -function tagComponent(props: { value: string }) { - return {props.value}; -} - -function itemComponent(props: { value: string }) { - return {props.value}; -} - -function listComponent(props: { value: string }) { - return {props.value}; -} - -class Test extends React.Component { - render() { - return ( -
-
- - - - - - - -
-
- - - - - - - -
-
- - - - - - - -
-
- - - - - -
-
- - - - - - - -
-
- - - - } /> - - - - - - - -
-
- } - /> -
-
- { - if (str) { - return new Date(str); - } - return undefined; - }} - /> -
-
- ); - } -} diff --git a/types/react-widgets/tsconfig.json b/types/react-widgets/tsconfig.json deleted file mode 100644 index 4ab85f3a0e29d9..00000000000000 --- a/types/react-widgets/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "jsx": "react", - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "react-widgets-tests.tsx" - ] -} diff --git a/types/react/v18/index.d.ts b/types/react/v18/index.d.ts index b27bdaba1ae551..ff14b026894c1c 100644 --- a/types/react/v18/index.d.ts +++ b/types/react/v18/index.d.ts @@ -3894,6 +3894,7 @@ declare namespace React { textRendering?: number | string | undefined; to?: number | string | undefined; transform?: string | undefined; + transformOrigin?: string | undefined; u1?: number | string | undefined; u2?: number | string | undefined; underlinePosition?: number | string | undefined; diff --git a/types/react/v18/test/elementAttributes.tsx b/types/react/v18/test/elementAttributes.tsx index de9e838b50db61..b21bdb729c987e 100644 --- a/types/react/v18/test/elementAttributes.tsx +++ b/types/react/v18/test/elementAttributes.tsx @@ -45,6 +45,7 @@ const testCases = [ , + ,
{}} name="foo" />, , diff --git a/types/supertest/supertest-tests.ts b/types/supertest/supertest-tests.ts index 1f1015c57c71a8..8923af6a5ff4c0 100644 --- a/types/supertest/supertest-tests.ts +++ b/types/supertest/supertest-tests.ts @@ -1,8 +1,10 @@ +// Ensure our types support promise-based servers +/* eslint @typescript-eslint/no-misused-promises: "error" */ import supertest = require("supertest"); import express = require("express"); import { Server as HttpServer } from "http"; -import { Http2SecureServer, Http2Server } from "http2"; +import type { Http2SecureServer, Http2Server, Http2ServerRequest, Http2ServerResponse } from "http2"; import { Server as HttpsServer } from "https"; const app = express(); @@ -14,6 +16,7 @@ supertest({} as HttpServer).get("/user").expect(200); supertest({} as HttpsServer).get("/user").expect(200); supertest({} as Http2Server).get("/user").expect(200); supertest({} as Http2SecureServer).get("/user").expect(200); +supertest({} as (request: Http2ServerRequest, response: Http2ServerResponse) => Promise).get("/user").expect(200); request.get("/user") .set("Accept", "*/*") diff --git a/types/supertest/types.d.ts b/types/supertest/types.d.ts index e8d651d4ab1744..927fc6ccb37ea5 100644 --- a/types/supertest/types.d.ts +++ b/types/supertest/types.d.ts @@ -7,7 +7,7 @@ import { Server } from "net"; export type App = | Server | RequestListener - | ((request: Http2ServerRequest, response: Http2ServerResponse) => void) + | ((request: Http2ServerRequest, response: Http2ServerResponse) => void | Promise) | string; export interface AgentOptions extends SAgentOptions { diff --git a/types/systemjs/package.json b/types/systemjs/package.json index 3135ee9064a383..2ff025586188dd 100644 --- a/types/systemjs/package.json +++ b/types/systemjs/package.json @@ -10,8 +10,8 @@ }, "owners": [ { - "name": "Joel Denning", - "githubUsername": "joeldenning" + "name": "Jolyn Denning", + "githubUsername": "jolyndenning" } ] } diff --git a/types/tunnel-ssh/.npmignore b/types/tunnel-ssh/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/tunnel-ssh/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/tunnel-ssh/index.d.ts b/types/tunnel-ssh/index.d.ts deleted file mode 100644 index 60929fa6e66128..00000000000000 --- a/types/tunnel-ssh/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as net from "net"; -import * as ssh2 from "ssh2"; - -export interface TunnelOptions { - autoClose?: boolean; -} -export interface ForwardOptions { - srcAddr: string; - srcPort: number; - dstAddr: string; - dstPort: number; -} - -export function createTunnel( - tunnelOptions: TunnelOptions, - serverOptions: net.ListenOptions, - sshOptions: ssh2.ConnectConfig, - forwardOptions: ForwardOptions, -): Promise<[net.Server, ssh2.Client]>; diff --git a/types/tunnel-ssh/package.json b/types/tunnel-ssh/package.json deleted file mode 100644 index 3b912280c3f5c8..00000000000000 --- a/types/tunnel-ssh/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "private": true, - "name": "@types/tunnel-ssh", - "version": "5.0.9999", - "projects": [ - "https://github.com/agebrock/tunnel-ssh" - ], - "dependencies": { - "@types/ssh2": "*" - }, - "devDependencies": { - "@types/tunnel-ssh": "workspace:." - }, - "owners": [] -} diff --git a/types/tunnel-ssh/tsconfig.json b/types/tunnel-ssh/tsconfig.json deleted file mode 100644 index 6eb5a1cee20135..00000000000000 --- a/types/tunnel-ssh/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "tunnel-ssh-tests.ts" - ] -} diff --git a/types/tunnel-ssh/tunnel-ssh-tests.ts b/types/tunnel-ssh/tunnel-ssh-tests.ts deleted file mode 100644 index 13e1969fb0b3d0..00000000000000 --- a/types/tunnel-ssh/tunnel-ssh-tests.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ListenOptions } from "net"; -import { ConnectConfig } from "ssh2"; -import { createTunnel, ForwardOptions, TunnelOptions } from "tunnel-ssh"; - -const tunnelOptions: TunnelOptions = { - autoClose: true, -}; - -const serverOptions: ListenOptions = { - port: 22, -}; - -const sshOptions: ConnectConfig = { - host: "localhost", - port: 22, - username: "username", - password: "password", -}; - -const forwardOptions: ForwardOptions = { - srcAddr: "localhost", - srcPort: 5433, - dstAddr: "localhost", - dstPort: 5432, -}; - -(async () => { - try { - const [server, client] = await createTunnel(tunnelOptions, serverOptions, sshOptions, forwardOptions); - client.end(); - server.close(); - } catch (err) { - console.log(err); - } -})(); diff --git a/types/tuya-panel-kit/@react-navigation/core/BaseNavigationContainer.d.ts b/types/tuya-panel-kit/@react-navigation/core/BaseNavigationContainer.d.ts deleted file mode 100644 index 73d4653294ff1a..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/BaseNavigationContainer.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as React from "react"; -import type { NavigationContainerProps, NavigationContainerRef } from "./types"; -/** - * Container component which holds the navigation state. - * This should be rendered at the root wrapping the whole app. - * - * @param props.initialState Initial state object for the navigation tree. - * @param props.onStateChange Callback which is called with the latest navigation state when it changes. - * @param props.children Child elements to render the content. - * @param props.ref Ref object which refers to the navigation object containing helper methods. - */ -declare const BaseNavigationContainer: React.ForwardRefExoticComponent< - NavigationContainerProps & React.RefAttributes ->; -export default BaseNavigationContainer; diff --git a/types/tuya-panel-kit/@react-navigation/core/CurrentRenderContext.d.ts b/types/tuya-panel-kit/@react-navigation/core/CurrentRenderContext.d.ts deleted file mode 100644 index 43c29094e0748e..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/CurrentRenderContext.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from "react"; -/** - * Context which holds the values for the current navigation tree. - * Intended for use in SSR. This is not safe to use on the client. - */ -declare const CurrentRenderContext: React.Context< - { - // tslint:disable-next-line no-redundant-undefined - options?: object | undefined; - } | undefined ->; -export default CurrentRenderContext; diff --git a/types/tuya-panel-kit/@react-navigation/core/NavigationContext.d.ts b/types/tuya-panel-kit/@react-navigation/core/NavigationContext.d.ts deleted file mode 100644 index dcd836b7385b3b..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/NavigationContext.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as React from "react"; -import type { NavigationProp } from "./types"; -/** - * Context which holds the navigation prop for a screen. - */ -declare const NavigationContext: React.Context< - // tslint:disable-next-line use-default-type-parameter - NavigationProp, string, any, any, {}> | undefined ->; -export default NavigationContext; diff --git a/types/tuya-panel-kit/@react-navigation/core/NavigationHelpersContext.d.ts b/types/tuya-panel-kit/@react-navigation/core/NavigationHelpersContext.d.ts deleted file mode 100644 index 322f9f0a90187c..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/NavigationHelpersContext.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as React from "react"; -import type { NavigationHelpers } from "./types"; -/** - * Context which holds the navigation helpers of the parent navigator. - * Navigators should use this context in their view component. - */ -declare const NavigationHelpersContext: React.Context< - // tslint:disable-next-line use-default-type-parameter - NavigationHelpers, {}> | undefined ->; -export default NavigationHelpersContext; diff --git a/types/tuya-panel-kit/@react-navigation/core/NavigationRouteContext.d.ts b/types/tuya-panel-kit/@react-navigation/core/NavigationRouteContext.d.ts deleted file mode 100644 index 3630f8d0792a27..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/NavigationRouteContext.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import * as React from "react"; -import type { Route } from "../routers"; -/** - * Context which holds the route prop for a screen. - */ -// tslint:disable-next-line use-default-type-parameter -declare const NavigationContext: React.Context | undefined>; -export default NavigationContext; diff --git a/types/tuya-panel-kit/@react-navigation/core/createNavigatorFactory.d.ts b/types/tuya-panel-kit/@react-navigation/core/createNavigatorFactory.d.ts deleted file mode 100644 index 4f0a3271afa682..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/createNavigatorFactory.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type * as React from "react"; -import type { NavigationState } from "../routers"; -import type { EventMapBase, TypedNavigator } from "./types"; -/** - * Higher order component to create a `Navigator` and `Screen` pair. - * Custom navigators should wrap the navigator component in `createNavigator` before exporting. - * - * @param Navigator The navigtor component to wrap. - * @returns Factory method to create a `Navigator` and `Screen` pair. - */ -/* eslint-disable @definitelytyped/no-unnecessary-generics */ -export default function createNavigatorFactory< - State extends NavigationState, - ScreenOptions extends {}, - EventMap extends EventMapBase, - NavigatorComponent extends React.ComponentType, ->( - Navigator: NavigatorComponent, -): >() => TypedNavigator< - ParamList, - State, - ScreenOptions, - EventMap, - NavigatorComponent ->; -/* eslist-enable @definitelytyped/no-unnecessary-generics */ diff --git a/types/tuya-panel-kit/@react-navigation/core/getActionFromState.d.ts b/types/tuya-panel-kit/@react-navigation/core/getActionFromState.d.ts deleted file mode 100644 index b1c78102604d45..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/getActionFromState.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { CommonActions, NavigationState, PartialState } from "../routers"; -import type { NavigatorScreenParams, PathConfigMap } from "./types"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Options = { - initialRouteName?: string | undefined; - screens: PathConfigMap; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type NavigateAction = { - type: "NAVIGATE"; - payload: { - name: string; - params?: NavigatorScreenParams | undefined; - }; -}; -export default function getActionFromState( - state: PartialState, - options?: Options, -): NavigateAction | CommonActions.Action | undefined; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/core/getFocusedRouteNameFromRoute.d.ts b/types/tuya-panel-kit/@react-navigation/core/getFocusedRouteNameFromRoute.d.ts deleted file mode 100644 index 87425c61828158..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/getFocusedRouteNameFromRoute.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { NavigationState, PartialState, Route } from "../routers"; -export default function getFocusedRouteNameFromRoute( - route: Partial> & { - state?: PartialState | undefined; - }, -): string | undefined; diff --git a/types/tuya-panel-kit/@react-navigation/core/getPathFromState.d.ts b/types/tuya-panel-kit/@react-navigation/core/getPathFromState.d.ts deleted file mode 100644 index adc0c0b38d9b74..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/getPathFromState.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { NavigationState, PartialState } from "../routers"; -import type { PathConfigMap } from "./types"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Options = { - initialRouteName?: string | undefined; - screens: PathConfigMap; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type State = NavigationState | Omit, "stale">; -/** - * Utility to serialize a navigation state object to a path string. - * - * @example - * ```js - * getPathFromState( - * { - * routes: [ - * { - * name: 'Chat', - * params: { author: 'Jane', id: 42 }, - * }, - * ], - * }, - * { - * screens: { - * Chat: { - * path: 'chat/:author/:id', - * stringify: { author: author => author.toLowerCase() } - * } - * } - * } - * ) - * ``` - * - * @param state Navigation state to serialize. - * @param options Extra options to fine-tune how to serialize the path. - * @returns Path representing the state, e.g. /foo/bar?count=42. - */ -export default function getPathFromState(state: State, options?: Options): string; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/core/getStateFromPath.d.ts b/types/tuya-panel-kit/@react-navigation/core/getStateFromPath.d.ts deleted file mode 100644 index 7cdea66ded6c5e..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/getStateFromPath.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { NavigationState, PartialState } from "../routers"; -import type { PathConfigMap } from "./types"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Options = { - initialRouteName?: string | undefined; - screens: PathConfigMap; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type ResultState = PartialState & { - state?: ResultState | undefined; -}; -/** - * Utility to parse a path string to initial state object accepted by the container. - * This is useful for deep linking when we need to handle the incoming URL. - * - * @example - * ```js - * getStateFromPath( - * '/chat/jane/42', - * { - * screens: { - * Chat: { - * path: 'chat/:author/:id', - * parse: { id: Number } - * } - * } - * } - * ) - * ``` - * @param path Path string to parse and convert, e.g. /foo/bar?count=42. - * @param options Extra options to fine-tune how to parse the path. - */ -export default function getStateFromPath(path: string, options?: Options): ResultState | undefined; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/core/index.d.ts b/types/tuya-panel-kit/@react-navigation/core/index.d.ts deleted file mode 100644 index e5878f5f88126d..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from "../routers"; -export { default as BaseNavigationContainer } from "./BaseNavigationContainer"; -export { default as createNavigatorFactory } from "./createNavigatorFactory"; -export { default as CurrentRenderContext } from "./CurrentRenderContext"; -export { default as getActionFromState } from "./getActionFromState"; -export { default as getFocusedRouteNameFromRoute } from "./getFocusedRouteNameFromRoute"; -export { default as getPathFromState } from "./getPathFromState"; -export { default as getStateFromPath } from "./getStateFromPath"; -export { default as NavigationContext } from "./NavigationContext"; -export { default as NavigationHelpersContext } from "./NavigationHelpersContext"; -export { default as NavigationRouteContext } from "./NavigationRouteContext"; -export * from "./types"; -export { default as useFocusEffect } from "./useFocusEffect"; -export { default as useIsFocused } from "./useIsFocused"; -export { default as useNavigation } from "./useNavigation"; -export { default as useNavigationBuilder } from "./useNavigationBuilder"; -export { default as useNavigationState } from "./useNavigationState"; -export { default as useRoute } from "./useRoute"; diff --git a/types/tuya-panel-kit/@react-navigation/core/types.d.ts b/types/tuya-panel-kit/@react-navigation/core/types.d.ts deleted file mode 100644 index 13805c4538e21a..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/types.d.ts +++ /dev/null @@ -1,542 +0,0 @@ -import type * as React from "react"; -import type { - DefaultRouterOptions, - InitialState, - NavigationAction, - NavigationState, - ParamListBase, - PartialState, - Route, -} from "../routers"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type DefaultNavigatorOptions = - & DefaultRouterOptions> - & { - /** - * Children React Elements to extract the route configuration from. - * Only `Screen` components are supported as children. - */ - children: React.ReactNode; - /** - * Default options for all screens under this navigator. - */ - screenOptions?: - | ScreenOptions - | ((props: { - route: RouteProp; - navigation: any; - }) => ScreenOptions) - | undefined; - }; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type EventMapBase = Record; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type EventMapCore = { - focus: { - data: undefined; - }; - blur: { - data: undefined; - }; - state: { - data: { - state: State; - }; - }; - beforeRemove: { - data: { - action: NavigationAction; - }; - canPreventDefault: true; - }; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type EventArg< - EventName extends string, - CanPreventDefault extends boolean | undefined = false, - Data = undefined, -> = - & { - /** - * Type of the event (e.g. `focus`, `blur`) - */ - readonly type: EventName; - readonly target?: string | undefined; - } - & (CanPreventDefault extends true ? { - /** - * Whether `event.preventDefault()` was called on this event object. - */ - readonly defaultPrevented: boolean; - /** - * Prevent the default action which happens on this event. - */ - preventDefault(): void; - } - : {}) - & (undefined extends Data ? { - readonly data?: Readonly | undefined; - } - : { - readonly data: Readonly; - }); -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type EventListenerCallback = ( - e: EventArg, EventMap[EventName]["canPreventDefault"], EventMap[EventName]["data"]>, -) => void; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type EventConsumer = { - /** - * Subscribe to events from the parent navigator. - * - * @param type Type of the event (e.g. `focus`, `blur`) - * @param callback Callback listener which is executed upon receiving the event. - */ - addListener>( - type: EventName, - callback: EventListenerCallback, - ): () => void; - removeListener>( - type: EventName, - callback: EventListenerCallback, - ): void; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type EventEmitter = { - /** - * Emit an event to child screens. - * - * @param options.type Type of the event (e.g. `focus`, `blur`) - * @param [options.data] Optional information regarding the event. - * @param [options.target] Key of the target route which should receive the event. - * If not specified, all routes receive the event. - */ - emit>( - options: - & { - type: EventName; - target?: string | undefined; - } - & (EventMap[EventName]["canPreventDefault"] extends true ? { - canPreventDefault: true; - } - : {}) - & (undefined extends EventMap[EventName]["data"] ? { - data?: EventMap[EventName]["data"] | undefined; - } - : { - data: EventMap[EventName]["data"]; - }), - ): EventArg; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare class PrivateValueStore { - /** - * UGLY HACK! DO NOT USE THE TYPE!!! - * - * TypeScript requires a type to be used to be able to infer it. - * The type should exist as its own without any operations such as union. - * So we need to figure out a way to store this type in a property. - * The problem with a normal property is that it shows up in intelliSense. - * Adding private keyword works, but the annotation is stripped away in declaration. - * Turns out if we use an empty string, it doesn't show up in intelliSense. - */ - protected ""?: { - a: A; - b: B; - c: C; - } | undefined; -} -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type NavigationHelpersCommon = - & { - /** - * Dispatch an action or an update function to the router. - * The update function will receive the current state, - * - * @param action Action object or update function. - */ - dispatch(action: NavigationAction | ((state: State) => NavigationAction)): void; - /** - * Navigate to a route in current navigation tree. - * - * @param name Name of the route to navigate to. - * @param [params] Params object for the route. - */ - navigate( - ...args: undefined extends ParamList[RouteName] ? [RouteName] | [RouteName, ParamList[RouteName]] - : [RouteName, ParamList[RouteName]] - ): void; - /** - * Navigate to a route in current navigation tree. - * - * @param route Object with `key` or `name` for the route to navigate to, and a `params` object. - */ - navigate( - route: { - key: string; - params?: ParamList[RouteName] | undefined; - } | { - name: RouteName; - key?: string | undefined; - params: ParamList[RouteName]; - }, - ): void; - /** - * Reset the navigation state to the provided state. - * - * @param state Navigation state object. - */ - reset(state: PartialState | State): void; - /** - * Go back to the previous route in history. - */ - goBack(): void; - /** - * Check if the screen is focused. The method returns `true` if focused, `false` otherwise. - * Note that this method doesn't re-render screen when the focus changes. So don't use it in `render`. - * To get notified of focus changes, use `addListener('focus', cb)` and `addListener('blur', cb)`. - * To conditionally render content based on focus state, use the `useIsFocused` hook. - */ - isFocused(): boolean; - /** - * Check if dispatching back action will be handled by navigation. - * Note that this method doesn't re-render screen when the result changes. So don't use it in `render`. - */ - canGoBack(): boolean; - /** - * Returns the parent navigator, if any. Reason why the function is called - * dangerouslyGetParent is to warn developers against overusing it to eg. get parent - * of parent and other hard-to-follow patterns. - */ - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - dangerouslyGetParent | undefined>(): T; - /** - * Returns the navigator's state. Reason why the function is called - * dangerouslyGetState is to discourage developers to use internal navigation's state. - * Note that this method doesn't re-render screen when the result changes. So don't use it in `render`. - */ - dangerouslyGetState(): State; - } - & PrivateValueStore; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type NavigationHelpers = - & NavigationHelpersCommon - & EventEmitter - & { - /** - * Update the param object for the route. - * The new params will be shallow merged with the old one. - * - * @param params Params object for the current route. - */ - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - setParams(params: Partial): void; - }; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type NavigationContainerProps = { - /** - * Initial navigation state for the child navigators. - */ - initialState?: InitialState | undefined; - /** - * Callback which is called with the latest navigation state when it changes. - */ - onStateChange?: ((state: NavigationState | undefined) => void) | undefined; - /** - * Callback which is called when an action is not handled. - */ - onUnhandledAction?: ((action: NavigationAction) => void) | undefined; - /** - * Whether this navigation container should be independent of parent containers. - * If this is not set to `true`, this container cannot be nested inside another container. - * Setting it to `true` disconnects any children navigators from parent container. - */ - independent?: boolean | undefined; - /** - * Children elements to render. - */ - children: React.ReactNode; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type NavigationProp< - ParamList extends ParamListBase, - RouteName extends keyof ParamList = string, - State extends NavigationState = NavigationState, - ScreenOptions extends {} = {}, - EventMap extends EventMapBase = {}, -> = - & NavigationHelpersCommon - & { - /** - * Update the param object for the route. - * The new params will be shallow merged with the old one. - * - * @param params Params object for the current route. - */ - setParams(params: Partial): void; - /** - * Update the options for the route. - * The options object will be shallow merged with default options object. - * - * @param options Options object for the route. - */ - setOptions(options: Partial): void; - } - & EventConsumer> - & PrivateValueStore; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type RouteProp = Route< - Extract, - ParamList[RouteName] ->; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type CompositeNavigationProp< - A extends NavigationProp, - B extends NavigationHelpersCommon, -> = - & Omit> - & NavigationProp< - /** - * Param list from both navigation objects needs to be combined - * For example, we should be able to navigate to screens in both A and B - */ - & (A extends NavigationHelpersCommon ? T : never) - & (B extends NavigationHelpersCommon ? U : never), - /** - * The route name should refer to the route name specified in the first type - * Ideally it should work for any of them, but it's not possible to infer that way - */ - A extends NavigationProp ? R : string, - /** - * The type of state should refer to the state specified in the first type - */ - A extends NavigationProp ? S : NavigationState, - /** - * Screen options from both navigation objects needs to be combined - * This allows typechecking `setOptions` - */ - & (A extends NavigationProp ? O : {}) - & (B extends NavigationProp ? P : {}), - /** - * Event consumer config should refer to the config specified in the first type - * This allows typechecking `addListener`/`removeListener` - */ - A extends NavigationProp ? E : {} - >; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type Descriptor< - ParamList extends ParamListBase, - RouteName extends keyof ParamList = string, - State extends NavigationState = NavigationState, - ScreenOptions extends {} = {}, - EventMap extends EventMapBase = {}, -> = { - /** - * Render the component associated with this route. - */ - render(): React.JSX.Element; - /** - * Options for the route. - */ - options: ScreenOptions; - /** - * Navigation object for the screen - */ - navigation: NavigationProp; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type ScreenListeners = Partial< - { - [EventName in keyof (EventMap & EventMapCore)]: EventListenerCallback; - } ->; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type RouteConfig< - ParamList extends ParamListBase, - RouteName extends keyof ParamList, - State extends NavigationState, - ScreenOptions extends {}, - EventMap extends EventMapBase, -> = - & { - /** - * Route name of this screen. - */ - name: RouteName; - /** - * Navigator options for this screen. - */ - options?: - | ScreenOptions - | ((props: { - route: RouteProp; - navigation: any; - }) => ScreenOptions) - | undefined; - /** - * Event listeners for this screen. - */ - listeners?: - | ScreenListeners - | ((props: { - route: RouteProp; - navigation: any; - }) => ScreenListeners) - | undefined; - /** - * Initial params object for the route. - */ - initialParams?: Partial | undefined; - } - & ({ - /** - * React component to render for this screen. - */ - component: React.ComponentType; - getComponent?: never | undefined; - children?: never | undefined; - } | { - /** - * Lazily get a React component to render for this screen. - */ - getComponent: () => React.ComponentType; - component?: never | undefined; - children?: never | undefined; - } | { - /** - * Render callback to render content of this screen. - */ - children: (props: { - route: RouteProp; - navigation: any; - }) => React.ReactNode; - component?: never | undefined; - getComponent?: never | undefined; - }); -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type NavigationContainerEventMap = { - /** - * Event which fires when the navigation state changes. - */ - state: { - data: { - /** - * The updated state object after the state change. - */ - state: NavigationState | PartialState | undefined; - }; - }; - /** - * Event which fires when current options changes. - */ - options: { - data: { - options: object; - }; - }; - /** - * Event which fires when an action is dispatched. - * Only intended for debugging purposes, don't use it for app logic. - * This event will be emitted before state changes have been applied. - */ - __unsafe_action__: { - data: { - /** - * The action object which was dispatched. - */ - action: NavigationAction; - /** - * Whether the action was a no-op, i.e. resulted any state changes. - */ - noop: boolean; - }; - }; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type NavigationContainerRef = - & NavigationHelpers - & EventConsumer - & { - /** - * Reset the navigation state of the root navigator to the provided state. - * - * @param state Navigation state object. - */ - resetRoot(state?: PartialState | NavigationState): void; - /** - * Get the rehydrated navigation state of the navigation tree. - */ - getRootState(): NavigationState; - /** - * Get the currently focused navigation route. - */ - getCurrentRoute(): Route | undefined; - /** - * Get the currently focused route's options. - */ - getCurrentOptions(): object | undefined; - }; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type TypedNavigator< - ParamList extends ParamListBase, - State extends NavigationState, - ScreenOptions extends {}, - EventMap extends EventMapBase, - Navigator extends React.ComponentType, -> = { - /** - * Navigator component which manages the child screens. - */ - Navigator: React.ComponentType< - & Omit, keyof DefaultNavigatorOptions> - & DefaultNavigatorOptions - >; - /** - * Component used for specifying route configuration. - */ - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - Screen: ( - _: RouteConfig, - ) => null; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type NavigatorScreenParams = - | { - screen?: never | undefined; - params?: never | undefined; - initial?: never | undefined; - state: PartialState | State | undefined; - } - | { - [RouteName in keyof ParamList]: undefined extends ParamList[RouteName] ? { - screen: RouteName; - params?: ParamList[RouteName] | undefined; - initial?: boolean | undefined; - state?: never | undefined; - } - : { - screen: RouteName; - params: ParamList[RouteName]; - initial?: boolean | undefined; - state?: never | undefined; - }; - }[keyof ParamList]; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type PathConfig = { - path?: string | undefined; - exact?: boolean | undefined; - parse?: Record any> | undefined; - stringify?: Record string> | undefined; - screens?: PathConfigMap | undefined; - initialRouteName?: string | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type PathConfigMap = { - [routeName: string]: string | PathConfig; -}; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/core/useFocusEffect.d.ts b/types/tuya-panel-kit/@react-navigation/core/useFocusEffect.d.ts deleted file mode 100644 index 787d6a530be991..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/useFocusEffect.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers, @typescript-eslint/no-invalid-void-type -declare type EffectCallback = () => undefined | void | (() => void); -/** - * Hook to run an effect in a focused screen, similar to `React.useEffect`. - * This can be used to perform side-effects such as fetching data or subscribing to events. - * The passed callback should be wrapped in `React.useCallback` to avoid running the effect too often. - * - * @param callback Memoized callback containing the effect, should optionally return a cleanup function. - */ -export default function useFocusEffect(effect: EffectCallback): void; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/core/useIsFocused.d.ts b/types/tuya-panel-kit/@react-navigation/core/useIsFocused.d.ts deleted file mode 100644 index c5cb7503f34a9e..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/useIsFocused.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Hook to get the current focus state of the screen. Returns a `true` if screen is focused, otherwise `false`. - * This can be used if a component needs to render something based on the focus state. - */ -export default function useIsFocused(): boolean; diff --git a/types/tuya-panel-kit/@react-navigation/core/useNavigation.d.ts b/types/tuya-panel-kit/@react-navigation/core/useNavigation.d.ts deleted file mode 100644 index 605fd52f554f32..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/useNavigation.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ParamListBase } from "../routers"; -import type { NavigationProp } from "./types"; -/** - * Hook to access the navigation prop of the parent screen anywhere. - * - * @returns Navigation prop of the parent screen. - */ -// eslint-disable-next-line @definitelytyped/no-unnecessary-generics -export default function useNavigation>(): T; diff --git a/types/tuya-panel-kit/@react-navigation/core/useNavigationBuilder.d.ts b/types/tuya-panel-kit/@react-navigation/core/useNavigationBuilder.d.ts deleted file mode 100644 index 722ed5f81fff9b..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/useNavigationBuilder.d.ts +++ /dev/null @@ -1,297 +0,0 @@ -import { DefaultRouterOptions, NavigationState, PartialState, RouterFactory } from "../routers"; -import { DefaultNavigatorOptions, PrivateValueStore } from "./types"; -/** - * Hook for building navigators. - * - * @param createRouter Factory method which returns router object. - * @param options Options object containing `children` and additional options for the router. - * @returns An object containing `state`, `navigation`, `descriptors` objects. - */ -export default function useNavigationBuilder< - State extends NavigationState, - RouterOptions extends DefaultRouterOptions, - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - ActionHelpers extends Record void>, - ScreenOptions extends {}, - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - EventMap extends Record, ->( - createRouter: RouterFactory, - options: DefaultNavigatorOptions & RouterOptions, -): { - state: State; - navigation: - & { - dispatch( - action: - | Readonly<{ - type: string; - // tslint:disable-next-line no-redundant-undefined - payload?: object | undefined; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - }> - | (( - state: Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | PartialState> | undefined; - } - >; - type: string; - stale: false; - }>, - ) => Readonly<{ - type: string; - // tslint:disable-next-line no-redundant-undefined - payload?: object | undefined; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - }>), - ): void; - navigate(...args: [RouteName] | [RouteName, object | undefined]): void; - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - navigate( - route: { - key: string; - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - } | { - name: RouteName_1; - // tslint:disable-next-line no-redundant-undefined - key?: string | undefined; - params: object | undefined; - }, - ): void; - reset( - state: - | Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | PartialState> | undefined; - } - >; - type: string; - stale: false; - }> - | PartialState< - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | PartialState> | undefined; - } - >; - type: string; - stale: false; - }> - >, - ): void; - goBack(): void; - isFocused(): boolean; - canGoBack(): boolean; - dangerouslyGetParent< - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - T = - | import("./types").NavigationProp< - Record, - string, - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | PartialState> | undefined; - } - >; - type: string; - stale: false; - }>, - {}, - {} - > - | undefined, - >(): T; - dangerouslyGetState(): Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | PartialState> | undefined; - } - >; - type: string; - stale: false; - }>; - } - & PrivateValueStore, string, {}> - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - & import("./types").EventEmitter - & { - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - setParams(params: object | undefined): void; - } - & { - dispatch( - action: - | Readonly<{ - type: string; - // tslint:disable-next-line no-redundant-undefined - payload?: object | undefined; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - }> - | ((state: any) => Readonly<{ - type: string; - // tslint:disable-next-line no-redundant-undefined - payload?: object | undefined; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - }>), - ): void; - navigate(...args: [RouteName_3] | [RouteName_3, object | undefined]): void; - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - navigate( - route: { - key: string; - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - } | { - name: RouteName_4; - // tslint:disable-next-line no-redundant-undefined - key?: string | undefined; - params: object | undefined; - }, - ): void; - reset(state: any): void; - goBack(): void; - isFocused(): boolean; - canGoBack(): boolean; - dangerouslyGetParent< - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - T_1 = - | import("./types").NavigationProp< - Record, - string, - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | PartialState> | undefined; - } - >; - type: string; - stale: false; - }>, - {}, - {} - > - | undefined, - >(): T_1; - dangerouslyGetState(): any; - } - & { - setParams(params: object | undefined): void; - setOptions(options: Partial): void; - } - & import("./types").EventConsumer - & PrivateValueStore, string, any> - // eslint-disable-next-line @definitelytyped/no-unnecessary-generics - & ActionHelpers; - descriptors: Record< - string, - import("./types").Descriptor, string, State, ScreenOptions, {}> - >; -}; diff --git a/types/tuya-panel-kit/@react-navigation/core/useNavigationState.d.ts b/types/tuya-panel-kit/@react-navigation/core/useNavigationState.d.ts deleted file mode 100644 index a094d608c7933f..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/useNavigationState.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { NavigationState } from "../routers"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Selector = (state: NavigationState) => T; -/** - * Hook to get a value from the current navigation state using a selector. - * - * @param selector Selector function to get a value from the state. - */ -export default function useNavigationState(selector: Selector): T; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/core/useRoute.d.ts b/types/tuya-panel-kit/@react-navigation/core/useRoute.d.ts deleted file mode 100644 index 38b5152315deff..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/core/useRoute.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ParamListBase } from "../routers"; -import type { RouteProp } from "./types"; -/** - * Hook to access the route prop of the parent screen anywhere. - * - * @returns Route prop of the parent screen. - */ -// eslint-disable-next-line @definitelytyped/no-unnecessary-generics -export default function useRoute>(): T; diff --git a/types/tuya-panel-kit/@react-navigation/native/Link.d.ts b/types/tuya-panel-kit/@react-navigation/native/Link.d.ts deleted file mode 100644 index af7a1c0347bbb9..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/Link.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import * as React from "react"; -import { GestureResponderEvent, Text, TextProps } from "react-native"; -import type { NavigationAction } from "../core"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Props = - & { - to: string; - action?: NavigationAction | undefined; - target?: string | undefined; - onPress?: ((e: React.MouseEvent | GestureResponderEvent) => void) | undefined; - } - & (TextProps & { - children: React.ReactNode; - }); -/** - * Component to render link to another screen using a path. - * Uses an anchor tag on the web. - * - * @param props.to Absolute path to screen (e.g. `/feeds/hot`). - * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config. - * @param props.children Child elements to render the content. - */ -export default function Link({ to, action, ...rest }: Props): React.CElement; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/native/NavigationContainer.d.ts b/types/tuya-panel-kit/@react-navigation/native/NavigationContainer.d.ts deleted file mode 100644 index 0a0f93638ad082..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/NavigationContainer.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as React from "react"; -import { NavigationContainerProps, NavigationContainerRef } from "../core"; -import type { DocumentTitleOptions, LinkingOptions, Theme } from "./types"; -/** - * Container component which holds the navigation state designed for React Native apps. - * This should be rendered at the root wrapping the whole app. - * - * @param props.initialState Initial state object for the navigation tree. - * When deep link handling is enabled, this will override deep links when specified. - * Make sure that you don't specify an `initialState` when there's a deep link (`Linking.getInitialURL()`). - * @param props.onReady Callback which is called after the navigation tree mounts. - * @param props.onStateChange Callback which is called with the latest navigation state when it changes. - * @param props.theme Theme object for the navigators. - * @param props.linking Options for deep linking. Deep link handling is enabled when this prop is provided, unless `linking.enabled` is `false`. - * @param props.fallback Fallback component to render until we have finished getting initial state when linking is enabled. Defaults to `null`. - * @param props.documentTitle Options to configure the document title on Web. Updating document title is handled by default unless `documentTitle.enabled` is `false`. - * @param props.children Child elements to render the content. - * @param props.ref Ref object which refers to the navigation object containing helper methods. - */ -declare const NavigationContainer: React.ForwardRefExoticComponent< - NavigationContainerProps & { - // tslint:disable-next-line no-redundant-undefined - theme?: Theme | undefined; - // tslint:disable-next-line no-redundant-undefined - linking?: LinkingOptions | undefined; - fallback?: React.ReactNode | undefined; - // tslint:disable-next-line no-redundant-undefined - documentTitle?: DocumentTitleOptions | undefined; - // tslint:disable-next-line no-redundant-undefined - onReady?: (() => void) | undefined; - } & React.RefAttributes ->; -export default NavigationContainer; diff --git a/types/tuya-panel-kit/@react-navigation/native/ServerContainer.d.ts b/types/tuya-panel-kit/@react-navigation/native/ServerContainer.d.ts deleted file mode 100644 index 3d0538bef6a527..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/ServerContainer.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from "react"; -import { ServerContextType } from "./ServerContext"; -import type { ServerContainerRef } from "./types"; -declare const _default: React.ForwardRefExoticComponent< - ServerContextType & { - children: React.ReactNode; - } & React.RefAttributes ->; -/** - * Container component for server rendering. - * - * @param props.location Location object to base the initial URL for SSR. - * @param props.children Child elements to render the content. - * @param props.ref Ref object which contains helper methods. - */ -export default _default; diff --git a/types/tuya-panel-kit/@react-navigation/native/ServerContext.d.ts b/types/tuya-panel-kit/@react-navigation/native/ServerContext.d.ts deleted file mode 100644 index 1ea9fee0b1f8de..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/ServerContext.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as React from "react"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type ServerContextType = { - location?: { - pathname: string; - search: string; - } | undefined; -}; -declare const ServerContext: React.Context; -export default ServerContext; diff --git a/types/tuya-panel-kit/@react-navigation/native/index.d.ts b/types/tuya-panel-kit/@react-navigation/native/index.d.ts deleted file mode 100644 index f08b58f4f55e9d..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export * from "../core"; -export { default as Link } from "./Link"; -export { default as NavigationContainer } from "./NavigationContainer"; -export { default as ServerContainer } from "./ServerContainer"; -export { default as DarkTheme } from "./theming/DarkTheme"; -export { default as DefaultTheme } from "./theming/DefaultTheme"; -export { default as ThemeProvider } from "./theming/ThemeProvider"; -export { default as useTheme } from "./theming/useTheme"; -export * from "./types"; -export { default as useBackButton } from "./useBackButton"; -export { default as useLinkBuilder } from "./useLinkBuilder"; -export { default as useLinking } from "./useLinking"; -export { default as useLinkProps } from "./useLinkProps"; -export { default as useLinkTo } from "./useLinkTo"; -export { default as useScrollToTop } from "./useScrollToTop"; diff --git a/types/tuya-panel-kit/@react-navigation/native/theming/DarkTheme.d.ts b/types/tuya-panel-kit/@react-navigation/native/theming/DarkTheme.d.ts deleted file mode 100644 index 2c05893f721bbb..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/theming/DarkTheme.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Theme } from "../types"; -declare const DarkTheme: Theme; -export default DarkTheme; diff --git a/types/tuya-panel-kit/@react-navigation/native/theming/DefaultTheme.d.ts b/types/tuya-panel-kit/@react-navigation/native/theming/DefaultTheme.d.ts deleted file mode 100644 index c0e980a281db4c..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/theming/DefaultTheme.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Theme } from "../types"; -declare const DefaultTheme: Theme; -export default DefaultTheme; diff --git a/types/tuya-panel-kit/@react-navigation/native/theming/ThemeProvider.d.ts b/types/tuya-panel-kit/@react-navigation/native/theming/ThemeProvider.d.ts deleted file mode 100644 index dd13c4c9b29bf5..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/theming/ThemeProvider.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as React from "react"; -import type { Theme } from "../types"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Props = { - value: Theme; - children: React.ReactNode; -}; -export default function ThemeProvider({ value, children }: Props): React.JSX.Element; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/native/theming/useTheme.d.ts b/types/tuya-panel-kit/@react-navigation/native/theming/useTheme.d.ts deleted file mode 100644 index f213432a8753b1..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/theming/useTheme.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function useTheme(): import("..").Theme; diff --git a/types/tuya-panel-kit/@react-navigation/native/types.d.ts b/types/tuya-panel-kit/@react-navigation/native/types.d.ts deleted file mode 100644 index ca92fe1aafc652..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/types.d.ts +++ /dev/null @@ -1,112 +0,0 @@ -import type { - getPathFromState as getPathFromStateDefault, - getStateFromPath as getStateFromPathDefault, - PathConfigMap, - Route, -} from "../core"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type Theme = { - dark: boolean; - colors: { - primary: string; - background: string; - card: string; - text: string; - border: string; - notification: string; - }; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type LinkingOptions = { - /** - * Whether deep link handling should be enabled. - * Defaults to true. - */ - enabled?: boolean | undefined; - /** - * The prefixes are stripped from the URL before parsing them. - * Usually they are the `scheme` + `host` (e.g. `myapp://chat?user=jane`) - * Only applicable on Android and iOS. - * - * @example - * ```js - * { - * prefixes: [ - * "myapp://", // App-specific scheme - * "https://example.com", // Prefix for universal links - * "https://*.example.com" // Prefix which matches any subdomain - * ] - * } - * ``` - */ - prefixes: string[]; - /** - * Config to fine-tune how to parse the path. - * - * @example - * ```js - * { - * Chat: { - * path: 'chat/:author/:id', - * parse: { id: Number } - * } - * } - * ``` - */ - config?: { - initialRouteName?: string | undefined; - screens: PathConfigMap; - } | undefined; - /** - * Custom function to get the initial URL used for linking. - * Uses `Linking.getInitialURL()` by default. - * Not supported on Web. - * - * @example - * ```js - * { - * getInitialURL () => Linking.getInitialURL(), - * } - * ``` - */ - getInitialURL?: (() => Promise) | undefined; - /** - * Custom function to get subscribe to URL updates. - * Uses `Linking.addEventListener('url', callback)` by default. - * Not supported on Web. - * - * @example - * ```js - * { - * subscribe: (listener) => { - * const onReceiveURL = ({ url }) => listener(url); - * - * Linking.addEventListener('url', onReceiveURL); - * - * return () => Linking.removeEventListener('url', onReceiveURL); - * } - * } - * ``` - */ - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - subscribe?: ((listener: (url: string) => void) => undefined | void | (() => void)) | undefined; - /** - * Custom function to parse the URL to a valid navigation state (advanced). - */ - getStateFromPath?: typeof getStateFromPathDefault | undefined; - /** - * Custom function to convert the state object to a valid URL (advanced). - * Only applicable on Web. - */ - getPathFromState?: typeof getPathFromStateDefault | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type DocumentTitleOptions = { - enabled?: boolean | undefined; - formatter?: ((options: Record | undefined, route: Route | undefined) => string) | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type ServerContainerRef = { - getCurrentOptions(): Record | undefined; -}; diff --git a/types/tuya-panel-kit/@react-navigation/native/useBackButton.d.ts b/types/tuya-panel-kit/@react-navigation/native/useBackButton.d.ts deleted file mode 100644 index 2d6547c6d41679..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/useBackButton.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as React from "react"; -import type { NavigationContainerRef } from "../core"; -export default function useBackButton(ref: React.RefObject): void; diff --git a/types/tuya-panel-kit/@react-navigation/native/useLinkBuilder.d.ts b/types/tuya-panel-kit/@react-navigation/native/useLinkBuilder.d.ts deleted file mode 100644 index 74be4fd2e26234..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/useLinkBuilder.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Build destination link for a navigate action. - * Useful for showing anchor tags on the web for buttons that perform navigation. - */ -// tslint:disable-next-line no-redundant-undefined -export default function useLinkBuilder(): (name: string, params?: object) => string | undefined; diff --git a/types/tuya-panel-kit/@react-navigation/native/useLinkProps.d.ts b/types/tuya-panel-kit/@react-navigation/native/useLinkProps.d.ts deleted file mode 100644 index cbb50f818b9344..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/useLinkProps.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as React from "react"; -import { GestureResponderEvent } from "react-native"; -import { NavigationAction } from "../core"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Props = { - to: string; - action?: NavigationAction | undefined; -}; -/** - * Hook to get props for an anchor tag so it can work with in page navigation. - * - * @param props.to Absolute path to screen (e.g. `/feeds/hot`). - * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config. - */ -export default function useLinkProps({ to, action }: Props): { - href: string; - accessibilityRole: "link"; - // tslint:disable-next-line no-redundant-undefined - onPress: (e?: React.MouseEvent | GestureResponderEvent) => void; -}; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/native/useLinkTo.d.ts b/types/tuya-panel-kit/@react-navigation/native/useLinkTo.d.ts deleted file mode 100644 index 3db1712c5e9266..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/useLinkTo.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function useLinkTo(): (path: string) => void; diff --git a/types/tuya-panel-kit/@react-navigation/native/useLinking.d.ts b/types/tuya-panel-kit/@react-navigation/native/useLinking.d.ts deleted file mode 100644 index f3ef7c56951e1c..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/useLinking.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -import * as React from "react"; -import { NavigationContainerRef } from "../core"; -import type { LinkingOptions } from "./types"; -export default function useLinking( - ref: React.RefObject, - { enabled, config, getStateFromPath, getPathFromState }: LinkingOptions, -): { - getInitialState: () => PromiseLike< - ( - & Partial< - Pick< - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | import("../core").PartialState> | undefined; - } - >; - type: string; - stale: false; - }>, - "key" | "index" | "routeNames" | "history" | "type" - > - > - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - stale?: true | undefined; - // tslint:disable-next-line array-type - routes: Array>>; - }> - & { - state?: - | ( - & Partial< - Pick< - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: - | Readonly - | import("../core").PartialState> - | undefined; - } - >; - type: string; - stale: false; - }>, - "key" | "index" | "routeNames" | "history" | "type" - > - > - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - stale?: true | undefined; - // tslint:disable-next-line array-type - routes: Array< - import("../core").PartialRoute< - import("../core").Route - > - >; - // tslint:disable-next-line no-redundant-undefined - }> - & any - ) - | undefined; - } - ) | undefined - >; -}; diff --git a/types/tuya-panel-kit/@react-navigation/native/useScrollToTop.d.ts b/types/tuya-panel-kit/@react-navigation/native/useScrollToTop.d.ts deleted file mode 100644 index 6805bfdbd8d11f..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/native/useScrollToTop.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import * as React from "react"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type ScrollOptions = { - y?: number | undefined; - animated?: boolean | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type ScrollableView = { - scrollToTop(): void; -} | { - scrollTo(options: ScrollOptions): void; -} | { - scrollToOffset(options: { - offset?: number | undefined; - animated?: boolean | undefined; - }): void; -} | { - scrollResponderScrollTo(options: ScrollOptions): void; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type ScrollableWrapper = { - getScrollResponder(): React.ReactNode; -} | { - getNode(): ScrollableView; -} | ScrollableView; -export default function useScrollToTop(ref: React.RefObject): void; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/routers/BaseRouter.d.ts b/types/tuya-panel-kit/@react-navigation/routers/BaseRouter.d.ts deleted file mode 100644 index d2428f4b713cf0..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/routers/BaseRouter.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { CommonNavigationAction, PartialState } from "./types"; -/** - * Base router object that can be used when writing custom routers. - * This provides few helper methods to handle common actions such as `RESET`. - */ -declare const BaseRouter: { - getStateForAction< - State extends Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | PartialState> | undefined; - } - >; - type: string; - stale: false; - }>, - >(state: State, action: CommonNavigationAction): State | PartialState | null; - shouldActionChangeFocus(action: CommonNavigationAction): boolean; -}; -export default BaseRouter; diff --git a/types/tuya-panel-kit/@react-navigation/routers/CommonActions.d.ts b/types/tuya-panel-kit/@react-navigation/routers/CommonActions.d.ts deleted file mode 100644 index c77f24ee89b870..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/routers/CommonActions.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { NavigationState, PartialState, Route } from "./types"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type ResetState = - | PartialState - | NavigationState - | (Omit & { - // tslint:disable-next-line array-type - routes: Array, "key">>; - }); -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type Action = { - type: "GO_BACK"; - source?: string | undefined; - target?: string | undefined; -} | { - type: "NAVIGATE"; - payload: { - key: string; - name?: undefined; - params?: object | undefined; - merge?: boolean | undefined; - } | { - name: string; - key?: string | undefined; - params?: object | undefined; - merge?: boolean | undefined; - }; - source?: string | undefined; - target?: string | undefined; -} | { - type: "RESET"; - payload: ResetState | undefined; - source?: string | undefined; - target?: string | undefined; -} | { - type: "SET_PARAMS"; - payload: { - params?: object | undefined; - }; - source?: string | undefined; - target?: string | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function goBack(): Action; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function navigate( - route: { - key: string; - params?: object | undefined; - } | { - name: string; - key?: string | undefined; - params?: object | undefined; - }, -): Action; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function navigate(name: string, params?: object): Action; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function reset(state: ResetState | undefined): Action; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function setParams(params: object): Action; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/routers/DrawerRouter.d.ts b/types/tuya-panel-kit/@react-navigation/routers/DrawerRouter.d.ts deleted file mode 100644 index e433be34dfd8d1..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/routers/DrawerRouter.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { TabActionHelpers, TabActionType, TabNavigationState, TabRouterOptions } from "./TabRouter"; -import type { CommonNavigationAction, ParamListBase, Router } from "./types"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type DrawerActionType = TabActionType | { - type: "OPEN_DRAWER" | "CLOSE_DRAWER" | "TOGGLE_DRAWER"; - source?: string | undefined; - target?: string | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type DrawerRouterOptions = TabRouterOptions & { - openByDefault?: boolean | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type DrawerNavigationState = - & Omit, "type" | "history"> - & { - /** - * Type of the router, in this case, it's drawer. - */ - type: "drawer"; - /** - * List of previously visited route keys and drawer open status. - */ - // tslint:disable-next-line array-type - history: Array< - { - type: "route"; - key: string; - } | { - type: "drawer"; - } - >; - }; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type DrawerActionHelpers = TabActionHelpers & { - /** - * Open the drawer sidebar. - */ - openDrawer(): void; - /** - * Close the drawer sidebar. - */ - closeDrawer(): void; - /** - * Open the drawer sidebar if closed, or close if opened. - */ - toggleDrawer(): void; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const DrawerActions: { - openDrawer(): DrawerActionType; - closeDrawer(): DrawerActionType; - // tslint:disable-next-line no-redundant-undefined - toggleDrawer(): DrawerActionType; - // tslint:disable-next-line no-redundant-undefined - jumpTo(name: string, params?: object): TabActionType; -}; -export default function DrawerRouter( - { openByDefault, ...rest }: DrawerRouterOptions, -): Router, DrawerActionType | CommonNavigationAction>; diff --git a/types/tuya-panel-kit/@react-navigation/routers/StackRouter.d.ts b/types/tuya-panel-kit/@react-navigation/routers/StackRouter.d.ts deleted file mode 100644 index 073eecd3639267..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/routers/StackRouter.d.ts +++ /dev/null @@ -1,261 +0,0 @@ -import type { DefaultRouterOptions, NavigationState, ParamListBase, Route, Router } from "./types"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackActionType = { - type: "REPLACE"; - payload: { - name: string; - // eslint-disable-next-line @typescript-eslint/consistent-type-definitions - key?: string | undefined; - params?: object | undefined; - }; - source?: string | undefined; - target?: string | undefined; -} | { - type: "PUSH"; - payload: { - name: string; - // tslint:disable-next-line no-redundant-undefined - key?: string | undefined; - params?: object | undefined; - }; - source?: string | undefined; - target?: string | undefined; -} | { - type: "POP"; - payload: { - count: number; - }; - source?: string | undefined; - target?: string | undefined; -} | { - type: "POP_TO_TOP"; - source?: string | undefined; - target?: string | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackRouterOptions = DefaultRouterOptions; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackNavigationState = NavigationState & { - /** - * Type of the router, in this case, it's stack. - */ - type: "stack"; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackActionHelpers = { - /** - * Replace the current route with a new one. - * - * @param name Route name of the new route. - * @param [params] Params object for the new route. - */ - replace( - ...args: undefined extends ParamList[RouteName] ? [RouteName] | [RouteName, ParamList[RouteName]] - : [RouteName, ParamList[RouteName]] - ): void; - /** - * Push a new screen onto the stack. - * - * @param name Name of the route for the tab. - * @param [params] Params object for the route. - */ - push( - ...args: undefined extends ParamList[RouteName] ? [RouteName] | [RouteName, ParamList[RouteName]] - : [RouteName, ParamList[RouteName]] - ): void; - /** - * Pop a screen from the stack. - */ - pop(count?: number): void; - /** - * Pop to the first route in the stack, dismissing all other screens. - */ - popToTop(): void; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const StackActions: { - // tslint:disable-next-line no-redundant-undefined - replace(name: string, params?: object): StackActionType; - // tslint:disable-next-line no-redundant-undefined - push(name: string, params?: object): StackActionType; - pop(count?: number): StackActionType; - popToTop(): StackActionType; -}; -export default function StackRouter( - options: StackRouterOptions, -): Router< - StackNavigationState>, - { - type: "GO_BACK"; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | { - type: "NAVIGATE"; - payload: { - key: string; - // tslint:disable-next-line no-redundant-undefined - name?: undefined; - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - // tslint:disable-next-line no-redundant-undefined - merge?: boolean | undefined; - } | { - name: string; - // tslint:disable-next-line no-redundant-undefined - key?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - // tslint:disable-next-line no-redundant-undefined - merge?: boolean | undefined; - }; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | { - type: "RESET"; - payload: - | Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | import("./types").PartialState> | undefined; - } - >; - type: string; - stale: false; - }> - | import("./types").PartialState< - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | import("./types").PartialState> | undefined; - } - >; - type: string; - stale: false; - }> - > - | ( - & Pick< - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined array-type - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | import("./types").PartialState> | undefined; - } - >; - type: string; - stale: false; - }>, - "stale" | "key" | "index" | "routeNames" | "history" | "type" - > - & { - // tslint:disable-next-line array-type use-default-type-parameter - routes: Array, "name" | "params">>; - } - ) - | undefined; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | { - type: "SET_PARAMS"; - payload: { - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | { - type: "REPLACE"; - payload: { - name: string; - // tslint:disable-next-line no-redundant-undefined - key?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | { - type: "PUSH"; - payload: { - name: string; - // tslint:disable-next-line no-redundant-undefined - key?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | { - type: "POP"; - payload: { - count: number; - }; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | { - type: "POP_TO_TOP"; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } ->; diff --git a/types/tuya-panel-kit/@react-navigation/routers/TabRouter.d.ts b/types/tuya-panel-kit/@react-navigation/routers/TabRouter.d.ts deleted file mode 100644 index d5a2e8e020ef9b..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/routers/TabRouter.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -import type { DefaultRouterOptions, NavigationState, ParamListBase, PartialState, Route, Router } from "./types"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type TabActionType = { - type: "JUMP_TO"; - payload: { - name: string; - params?: object | undefined; - }; - source?: string | undefined; - target?: string | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type BackBehavior = "initialRoute" | "order" | "history" | "none"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type TabRouterOptions = DefaultRouterOptions & { - backBehavior?: BackBehavior | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type TabNavigationState = - & Omit, "history"> - & { - /** - * Type of the router, in this case, it's tab. - */ - type: "tab"; - /** - * List of previously visited route keys. - */ - // tslint:disable-next-line array-type - history: Array<{ - type: "route"; - key: string; - }>; - }; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type TabActionHelpers = { - /** - * Jump to an existing tab. - * - * @param name Name of the route for the tab. - * @param [params] Params object for the route. - */ - jumpTo>( - ...args: undefined extends ParamList[RouteName] ? [RouteName] | [RouteName, ParamList[RouteName]] - : [RouteName, ParamList[RouteName]] - ): void; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const TabActions: { - // tslint:disable-next-line no-redundant-undefined - jumpTo(name: string, params?: object): TabActionType; -}; -export default function TabRouter( - { initialRouteName, backBehavior }: TabRouterOptions, -): Router< - TabNavigationState>, - { - type: "GO_BACK"; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | { - type: "NAVIGATE"; - payload: { - key: string; - name?: undefined; - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - // tslint:disable-next-line no-redundant-undefined - merge?: boolean | undefined; - } | { - name: string; - // tslint:disable-next-line no-redundant-undefined - key?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - // tslint:disable-next-line no-redundant-undefined - merge?: boolean | undefined; - }; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | { - type: "RESET"; - payload: - | Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined array-type - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | PartialState> | undefined; - } - >; - type: string; - stale: false; - }> - | PartialState< - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | PartialState> | undefined; - } - >; - type: string; - stale: false; - }> - > - | ( - & Pick< - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - // tslint:disable-next-line no-redundant-undefined - state?: Readonly | PartialState> | undefined; - } - >; - type: string; - stale: false; - }>, - "stale" | "key" | "index" | "routeNames" | "history" | "type" - > - & { - // tslint:disable-next-line no-redundant-undefined array-type use-default-type-parameter - routes: Array, "name" | "params">>; - } - ) - | undefined; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | { - type: "SET_PARAMS"; - /** - * List of previously visited route keys. - */ - payload: { - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }; - // tslint:disable-next-line no-redundant-undefined - source?: string | undefined; - // tslint:disable-next-line no-redundant-undefined - target?: string | undefined; - } | TabActionType ->; diff --git a/types/tuya-panel-kit/@react-navigation/routers/index.d.ts b/types/tuya-panel-kit/@react-navigation/routers/index.d.ts deleted file mode 100644 index bcfaa5ca6c95dc..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/routers/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as CommonActions from "./CommonActions"; -export { CommonActions }; -export { default as BaseRouter } from "./BaseRouter"; -export { default as DrawerRouter, DrawerActions } from "./DrawerRouter"; -export type { DrawerActionHelpers, DrawerActionType, DrawerNavigationState, DrawerRouterOptions } from "./DrawerRouter"; -export { default as StackRouter, StackActions } from "./StackRouter"; -export type { StackActionHelpers, StackActionType, StackNavigationState, StackRouterOptions } from "./StackRouter"; -export { default as TabRouter, TabActions } from "./TabRouter"; -export type { TabActionHelpers, TabActionType, TabNavigationState, TabRouterOptions } from "./TabRouter"; -export * from "./types"; diff --git a/types/tuya-panel-kit/@react-navigation/routers/types.d.ts b/types/tuya-panel-kit/@react-navigation/routers/types.d.ts deleted file mode 100644 index 3f8ab3da5e6d1a..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/routers/types.d.ts +++ /dev/null @@ -1,196 +0,0 @@ -import type * as CommonActions from "./CommonActions"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type CommonNavigationAction = CommonActions.Action; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type NavigationRoute = - & Route, ParamList[RouteName]> - & { - state?: NavigationState | PartialState | undefined; - }; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type NavigationState = Readonly<{ - /** - * Unique key for the navigation state. - */ - key: string; - /** - * Index of the currently focused route. - */ - index: number; - /** - * List of valid route names as defined in the screen components. - */ - // tslint:disable-next-line array-type - routeNames: Array>; - /** - * Alternative entries for history. - */ - history?: unknown[] | undefined; - /** - * List of rendered routes. - */ - // tslint:disable-next-line array-type - routes: Array>; - /** - * Custom type for the state, whether it's for tab, stack, drawer etc. - * During rehydration, the state will be discarded if type doesn't match with router type. - * It can also be used to detect the type of the navigator we're dealing with. - */ - type: string; - /** - * Whether the navigation state has been rehydrated. - */ - stale: false; -}>; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type InitialState = Readonly< - Partial> & { - // tslint:disable-next-line array-type - routes: Array< - Omit, "key"> & { - state?: InitialState | undefined; - } - >; - } ->; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type PartialRoute> = Omit & { - key?: string | undefined; - state?: PartialState | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type PartialState = - & Partial> - & Readonly<{ - stale?: true | undefined; - // tslint:disable-next-line array-type - routes: Array>>; - }>; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type Route = - & Readonly<{ - /** - * Unique key for the route. - */ - key: string; - /** - * User-provided name for the route. - */ - name: RouteName; - }> - & (undefined extends Params ? Readonly<{ - /** - * Params for this route - */ - params?: Readonly | undefined; - }> - : Readonly<{ - /** - * Params for this route - */ - params: Readonly; - }>); -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type ParamListBase = Record; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type NavigationAction = Readonly<{ - /** - * Type of the action (e.g. `NAVIGATE`) - */ - type: string; - /** - * Additional data for the action - */ - payload?: object | undefined; - /** - * Key of the route which dispatched this action. - */ - source?: string | undefined; - /** - * Key of the navigator which should handle this action. - */ - target?: string | undefined; -}>; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type ActionCreators = { - [key: string]: (...args: any) => Action; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type DefaultRouterOptions = { - /** - * Name of the route to focus by on initial render. - * If not specified, usually the first route is used. - */ - initialRouteName?: RouteName | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type RouterFactory< - State extends NavigationState, - Action extends NavigationAction, - RouterOptions extends DefaultRouterOptions, -> = (options: RouterOptions) => Router; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type RouterConfigOptions = { - routeNames: string[]; - routeParamList: ParamListBase; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type Router = { - /** - * Type of the router. Should match the `type` property in state. - * If the type doesn't match, the state will be discarded during rehydration. - */ - type: State["type"]; - /** - * Initialize the navigation state. - * - * @param options.routeNames List of valid route names as defined in the screen components. - * @param options.routeParamsList Object containing params for each route. - */ - getInitialState(options: RouterConfigOptions): State; - /** - * Rehydrate the full navigation state from a given partial state. - * - * @param partialState Navigation state to rehydrate from. - * @param options.routeNames List of valid route names as defined in the screen components. - * @param options.routeParamsList Object containing params for each route. - */ - getRehydratedState(partialState: PartialState | State, options: RouterConfigOptions): State; - /** - * Take the current state and updated list of route names, and return a new state. - * - * @param state State object to update. - * @param options.routeNames New list of route names. - * @param options.routeParamsList Object containing params for each route. - */ - getStateForRouteNamesChange(state: State, options: RouterConfigOptions): State; - /** - * Take the current state and key of a route, and return a new state with the route focused - * - * @param state State object to apply the action on. - * @param key Key of the route to focus. - */ - getStateForRouteFocus(state: State, key: string): State; - /** - * Take the current state and action, and return a new state. - * If the action cannot be handled, return `null`. - * - * @param state State object to apply the action on. - * @param action Action object to apply. - * @param options.routeNames List of valid route names as defined in the screen components. - * @param options.routeParamsList Object containing params for each route. - */ - getStateForAction(state: State, action: Action, options: RouterConfigOptions): State | PartialState | null; - /** - * Whether the action should also change focus in parent navigator - * - * @param action Action object to check. - */ - shouldActionChangeFocus(action: NavigationAction): boolean; - /** - * Action creators for the router. - */ - actionCreators?: ActionCreators | undefined; -}; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/CardStyleInterpolators.d.ts b/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/CardStyleInterpolators.d.ts deleted file mode 100644 index eb3dc4d304b696..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/CardStyleInterpolators.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { StackCardInterpolatedStyle, StackCardInterpolationProps } from "../types"; -/** - * Standard iOS-style slide in from the right. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forHorizontalIOS( - { current, next, inverted, layouts: { screen } }: StackCardInterpolationProps, -): StackCardInterpolatedStyle; -/** - * Standard iOS-style slide in from the bottom (used for modals). - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forVerticalIOS( - { current, inverted, layouts: { screen } }: StackCardInterpolationProps, -): StackCardInterpolatedStyle; -/** - * Standard iOS-style modal animation in iOS 13. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forModalPresentationIOS( - { index, current, next, inverted, layouts: { screen }, insets }: StackCardInterpolationProps, -): StackCardInterpolatedStyle; -/** - * Standard Android-style fade in from the bottom for Android Oreo. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forFadeFromBottomAndroid( - { current, inverted, layouts: { screen }, closing }: StackCardInterpolationProps, -): StackCardInterpolatedStyle; -/** - * Standard Android-style reveal from the bottom for Android Pie. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forRevealFromBottomAndroid( - { current, next, inverted, layouts: { screen } }: StackCardInterpolationProps, -): StackCardInterpolatedStyle; -/** - * Standard Android-style reveal from the bottom for Android Q. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forScaleFromCenterAndroid( - { current, next, closing }: StackCardInterpolationProps, -): StackCardInterpolatedStyle; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forNoAnimation(): StackCardInterpolatedStyle; diff --git a/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/HeaderStyleInterpolators.d.ts b/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/HeaderStyleInterpolators.d.ts deleted file mode 100644 index a5367e94decf0d..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/HeaderStyleInterpolators.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { StackHeaderInterpolatedStyle, StackHeaderInterpolationProps } from "../types"; -/** - * Standard UIKit style animation for the header where the title fades into the back button label. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forUIKit( - { current, next, layouts }: StackHeaderInterpolationProps, -): StackHeaderInterpolatedStyle; -/** - * Simple fade animation for the header elements. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forFade({ current, next }: StackHeaderInterpolationProps): StackHeaderInterpolatedStyle; -/** - * Simple translate animation to translate the header to left. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forSlideLeft( - { current, next, layouts: { screen } }: StackHeaderInterpolationProps, -): StackHeaderInterpolatedStyle; -/** - * Simple translate animation to translate the header to right. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forSlideRight( - { current, next, layouts: { screen } }: StackHeaderInterpolationProps, -): StackHeaderInterpolatedStyle; -/** - * Simple translate animation to translate the header to slide up. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forSlideUp( - { current, next, layouts: { header } }: StackHeaderInterpolationProps, -): StackHeaderInterpolatedStyle; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare function forNoAnimation(): StackHeaderInterpolatedStyle; diff --git a/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/TransitionPresets.d.ts b/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/TransitionPresets.d.ts deleted file mode 100644 index 266e6a6b6785ec..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/TransitionPresets.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { TransitionPreset } from "../types"; -/** - * Standard iOS navigation transition. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const SlideFromRightIOS: TransitionPreset; -/** - * Standard iOS navigation transition for modals. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const ModalSlideFromBottomIOS: TransitionPreset; -/** - * Standard iOS modal presentation style (introduced in iOS 13). - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const ModalPresentationIOS: TransitionPreset; -/** - * Standard Android navigation transition when opening or closing an Activity on Android < 9 (Oreo). - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const FadeFromBottomAndroid: TransitionPreset; -/** - * Standard Android navigation transition when opening or closing an Activity on Android 9 (Pie). - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const RevealFromBottomAndroid: TransitionPreset; -/** - * Standard Android navigation transition when opening or closing an Activity on Android 10 (Q). - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const ScaleFromCenterAndroid: TransitionPreset; -/** - * Default navigation transition for the current platform. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const DefaultTransition: TransitionPreset; -/** - * Default modal transition for the current platform. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const ModalTransition: TransitionPreset; diff --git a/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/TransitionSpecs.d.ts b/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/TransitionSpecs.d.ts deleted file mode 100644 index c7c11b4b2955c2..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/TransitionConfigs/TransitionSpecs.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { TransitionSpec } from "../types"; -/** - * Exact values from UINavigationController's animation configuration. - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const TransitionIOSSpec: TransitionSpec; -/** - * Configuration for activity open animation from Android Nougat. - * See http://aosp.opersys.com/xref/android-7.1.2_r37/xref/frameworks/base/core/res/res/anim/activity_open_enter.xml - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const FadeInFromBottomAndroidSpec: TransitionSpec; -/** - * Configuration for activity close animation from Android Nougat. - * See http://aosp.opersys.com/xref/android-7.1.2_r37/xref/frameworks/base/core/res/res/anim/activity_close_exit.xml - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const FadeOutToBottomAndroidSpec: TransitionSpec; -/** - * Approximate configuration for activity open animation from Android Pie. - * See http://aosp.opersys.com/xref/android-9.0.0_r47/xref/frameworks/base/core/res/res/anim/activity_open_enter.xml - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const RevealFromBottomAndroidSpec: TransitionSpec; -/** - * Approximate configuration for activity open animation from Android Q. - * See http://aosp.opersys.com/xref/android-10.0.0_r2/xref/frameworks/base/core/res/res/anim/activity_open_enter.xml - */ -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const ScaleFromCenterAndroidSpec: TransitionSpec; diff --git a/types/tuya-panel-kit/@react-navigation/stack/index.d.ts b/types/tuya-panel-kit/@react-navigation/stack/index.d.ts deleted file mode 100644 index 9bc950b1b4f3cf..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/index.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import * as CardStyleInterpolators from "./TransitionConfigs/CardStyleInterpolators"; -import * as HeaderStyleInterpolators from "./TransitionConfigs/HeaderStyleInterpolators"; -import * as TransitionPresets from "./TransitionConfigs/TransitionPresets"; -import * as TransitionSpecs from "./TransitionConfigs/TransitionSpecs"; -/** - * Navigators - */ -export { default as createStackNavigator } from "./navigators/createStackNavigator"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare const Assets: any[]; -/** - * Views - */ -export { default as Header } from "./views/Header/Header"; -export { default as HeaderBackButton } from "./views/Header/HeaderBackButton"; -export { default as HeaderBackground } from "./views/Header/HeaderBackground"; -export { default as HeaderTitle } from "./views/Header/HeaderTitle"; -export { default as StackView } from "./views/Stack/StackView"; -/** - * Transition presets - */ -export { CardStyleInterpolators, HeaderStyleInterpolators, TransitionPresets, TransitionSpecs }; -/** - * Utilities - */ -export { default as CardAnimationContext } from "./utils/CardAnimationContext"; -export { default as GestureHandlerRefContext } from "./utils/GestureHandlerRefContext"; -export { default as HeaderHeightContext } from "./utils/HeaderHeightContext"; -export { default as useCardAnimation } from "./utils/useCardAnimation"; -export { default as useGestureHandlerRef } from "./utils/useGestureHandlerRef"; -export { default as useHeaderHeight } from "./utils/useHeaderHeight"; -/** - * Types - */ -export type { - StackCardInterpolatedStyle, - StackCardInterpolationProps, - StackCardStyleInterpolator, - StackHeaderInterpolatedStyle, - StackHeaderInterpolationProps, - StackHeaderLeftButtonProps, - StackHeaderProps, - StackHeaderStyleInterpolator, - StackHeaderTitleProps, - StackNavigationOptions, - StackNavigationProp, - StackScreenProps, -} from "./types"; diff --git a/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts b/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts deleted file mode 100644 index 3b0e23cfe29ea7..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { JSX } from "react"; -import { DefaultNavigatorOptions, StackNavigationState, StackRouterOptions } from "../../native"; -import type { StackNavigationConfig, StackNavigationEventMap, StackNavigationOptions } from "../types"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Props = DefaultNavigatorOptions & StackRouterOptions & StackNavigationConfig; -declare function StackNavigator({ initialRouteName, children, screenOptions, ...rest }: Props): JSX.Element; -/* eslint-disable @definitelytyped/no-unnecessary-generics */ -/* eslint-disable @definitelytyped/prefer-declare-function */ -declare const _default: >() => - import("../../native").TypedNavigator< - ParamList, - StackNavigationState>, - StackNavigationOptions, - StackNavigationEventMap, - typeof StackNavigator - >; -/* eslist-enable @definitelytyped/prefer-declare-function */ -/* eslist-enable @definitelytyped/no-unnecessary-generics */ -export default _default; diff --git a/types/tuya-panel-kit/@react-navigation/stack/types.d.ts b/types/tuya-panel-kit/@react-navigation/stack/types.d.ts deleted file mode 100644 index c1b4e09ff7e070..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/types.d.ts +++ /dev/null @@ -1,663 +0,0 @@ -import type * as React from "react"; -import type { Animated, LayoutChangeEvent, StyleProp, TextStyle, ViewStyle } from "react-native"; -import type { EdgeInsets } from "react-native-safe-area-context"; -import type { - Descriptor, - NavigationHelpers, - NavigationProp, - ParamListBase, - Route, - RouteProp, - StackActionHelpers, - StackNavigationState, -} from "../native"; -// tslint:disable:interface-over-type-literal -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackNavigationEventMap = { - /** - * Event which fires when a transition animation starts. - */ - transitionStart: { - data: { - closing: boolean; - }; - }; - /** - * Event which fires when a transition animation ends. - */ - transitionEnd: { - data: { - closing: boolean; - }; - }; - /** - * Event which fires when navigation gesture starts. - */ - gestureStart: { - data: undefined; - }; - /** - * Event which fires when navigation gesture is completed. - */ - gestureEnd: { - data: undefined; - }; - /** - * Event which fires when navigation gesture is canceled. - */ - gestureCancel: { - data: undefined; - }; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackNavigationHelpers = - & NavigationHelpers - & StackActionHelpers; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackNavigationProp = - & NavigationProp< - ParamList, - RouteName, - StackNavigationState, - StackNavigationOptions, - StackNavigationEventMap - > - & StackActionHelpers; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackScreenProps = { - navigation: StackNavigationProp; - route: RouteProp; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type Layout = { - width: number; - height: number; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type GestureDirection = "horizontal" | "horizontal-inverted" | "vertical" | "vertical-inverted"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type Scene = { - /** - * Current route object, - */ - route: T; - /** - * Descriptor object for the route containing options and navigation object. - */ - descriptor: StackDescriptor; - /** - * Animated nodes representing the progress of the animation. - */ - progress: { - /** - * Progress value of the current screen. - */ - current: Animated.AnimatedInterpolation; - /** - * Progress value for the screen after this one in the stack. - * This can be `undefined` in case the screen animating is the last one. - */ - next?: Animated.AnimatedInterpolation | undefined; - /** - * Progress value for the screen before this one in the stack. - * This can be `undefined` in case the screen animating is the first one. - */ - previous?: Animated.AnimatedInterpolation | undefined; - }; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackHeaderMode = "float" | "screen" | "none"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackCardMode = "card" | "modal"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackHeaderOptions = { - /** - * String or a function that returns a React Element to be used by the header. - * Defaults to scene `title`. - * It receives `allowFontScaling`, `onLayout`, `style` and `children` in the options object as an argument. - * The title string is passed in `children`. - */ - headerTitle?: string | ((props: StackHeaderTitleProps) => React.ReactNode) | undefined; - /** - * How to align the the header title. - * Defaults to `center` on iOS and `left` on Android. - */ - headerTitleAlign?: "left" | "center" | undefined; - /** - * Style object for the title component. - */ - headerTitleStyle?: Animated.WithAnimatedValue> | undefined; - /** - * Style object for the container of the `headerTitle` component, for example to add padding. - * By default, `headerTitleContainerStyle` is with an absolute position style and offsets both `left` and `right`. - * This may lead to white space or overlap between `headerLeft` and `headerTitle` if a customized `headerLeft` is used. - * It can be solved by adjusting `left` and `right` style in `headerTitleContainerStyle` and `marginHorizontal` in `headerTitleStyle`. - */ - headerTitleContainerStyle?: Animated.WithAnimatedValue> | undefined; - /** - * Tint color for the header. - */ - headerTintColor?: string | undefined; - /** - * Whether header title font should scale to respect Text Size accessibility settings. Defaults to `false`. - */ - headerTitleAllowFontScaling?: boolean | undefined; - /** - * Whether back button title font should scale to respect Text Size accessibility settings. Defaults to `false`. - */ - headerBackAllowFontScaling?: boolean | undefined; - /** - * Accessibility label for the header back button. - */ - headerBackAccessibilityLabel?: string | undefined; - /** - * Title string used by the back button on iOS. Defaults to the previous scene's `headerTitle`. - * Use `headerBackTitleVisible: false` to hide it. - */ - headerBackTitle?: string | undefined; - /** - * Style object for the back title. - */ - headerBackTitleStyle?: StyleProp | undefined; - /** - * A reasonable default is supplied for whether the back button title should be visible or not. - * But if you want to override that you can use `true` or `false` in this option. - */ - headerBackTitleVisible?: boolean | undefined; - /** - * Title string used by the back button when `headerBackTitle` doesn't fit on the screen. `"Back"` by default. - */ - headerTruncatedBackTitle?: string | undefined; - /** - * Function which returns a React Element to display on the left side of the header. - * It receives a number of arguments when rendered (`onPress`, `label`, `labelStyle` and more. - */ - headerLeft?: ((props: StackHeaderLeftButtonProps) => React.ReactNode) | undefined; - /** - * Style object for the container of the `headerLeft` component, for example to add padding. - */ - headerLeftContainerStyle?: Animated.WithAnimatedValue> | undefined; - /** - * Function which returns a React Element to display on the right side of the header. - */ - headerRight?: - | ((props: { - tintColor?: string | undefined; - }) => React.ReactNode) - | undefined; - /** - * Style object for the container of the `headerRight` component, for example to add padding. - */ - headerRightContainerStyle?: Animated.WithAnimatedValue> | undefined; - /** - * Function which returns a React Element to display custom image in header's back button. - * It receives the `tintColor` in in the options object as an argument. object. - * Defaults to Image component with a the default back icon image for the platform (a chevron on iOS and an arrow on Android). - */ - headerBackImage?: StackHeaderLeftButtonProps["backImage"] | undefined; - /** - * Color for material ripple (Android >= 5.0 only). - */ - headerPressColorAndroid?: string | undefined; - /** - * Function which returns a React Element to render as the background of the header. - * This is useful for using backgrounds such as an image or a gradient. - * You can use this with `headerTransparent` to render a blur view, for example, to create a translucent header. - */ - headerBackground?: - | ((props: { - style: StyleProp; - }) => React.ReactNode) - | undefined; - /** - * Style object for the header. You can specify a custom background color here, for example. - */ - headerStyle?: Animated.WithAnimatedValue> | undefined; - /** - * Defaults to `false`. If `true`, the header will not have a background unless you explicitly provide it with `headerBackground`. - * The header will also float over the screen so that it overlaps the content underneath. - * This is useful if you want to render a semi-transparent header or a blurred background. - */ - headerTransparent?: boolean | undefined; - /** - * Extra padding to add at the top of header to account for translucent status bar. - * By default, it uses the top value from the safe area insets of the device. - * Pass 0 or a custom value to disable the default behaviour, and customize the height. - */ - headerStatusBarHeight?: number | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackHeaderProps = { - /** - * Mode of the header: `float` renders a single floating header across all screens, - * `screen` renders separate headers for each screen. - */ - mode: "float" | "screen"; - /** - * Layout of the screen. - */ - layout: Layout; - /** - * Safe area insets to use in the header, e.g. to apply extra spacing for statusbar and notch. - */ - insets: EdgeInsets; - /** - * Object representing the current scene, such as the route object and animation progress. - */ - scene: Scene>; - /** - * Object representing the previous scene. - */ - previous?: Scene> | undefined; - /** - * Navigation prop for the header. - */ - navigation: StackNavigationProp; - /** - * Interpolated styles for various elements in the header. - */ - styleInterpolator: StackHeaderStyleInterpolator; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackDescriptor = Descriptor< - ParamListBase, - string, - StackNavigationState, - StackNavigationOptions ->; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackDescriptorMap = { - [key: string]: StackDescriptor; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackNavigationOptions = StackHeaderOptions & Partial & { - /** - * String that can be displayed in the header as a fallback for `headerTitle`. - */ - title?: string | undefined; - /** - * Function that given `HeaderProps` returns a React Element to display as a header. - */ - header?: ((props: StackHeaderProps) => React.ReactNode) | undefined; - /** - * Whether to show the header. The header is shown by default unless `headerMode` was set to `none`. - * Setting this to `false` hides the header. - */ - headerShown?: boolean | undefined; - /** - * Whether a shadow is visible for the card during transitions. Defaults to `true`. - */ - cardShadowEnabled?: boolean | undefined; - /** - * Whether to have a semi-transparent dark overlay visible under the card during transitions. - * Defaults to `true` on Android and `false` on iOS. - */ - cardOverlayEnabled?: boolean | undefined; - /** - * Function that returns a React Element to display as a overlay for the card. - */ - cardOverlay?: - | ((props: { - style: Animated.WithAnimatedValue>; - }) => React.ReactNode) - | undefined; - /** - * Style object for the card in stack. - * You can provide a custom background color to use instead of the default background here. - * - * You can also specify `{ backgroundColor: 'transparent' }` to make the previous screen visible underneath. - * This is useful to implement things like modal dialogs. - * If you use [`react-native-screens`](https://github.com/kmagiera/react-native-screens), you should also specify `mode: 'modal'` - * in the stack view config when using a transparent background so previous screens aren't detached. - */ - cardStyle?: StyleProp | undefined; - /** - * Whether transition animation should be enabled the screen. - * If you set it to `false`, the screen won't animate when pushing or popping. - * Defaults to `true` on Android and iOS, `false` on Web. - */ - animationEnabled?: boolean | undefined; - /** - * The type of animation to use when this screen replaces another screen. Defaults to `push`. - * When `pop` is used, the `pop` animation is applied to the screen being replaced. - */ - animationTypeForReplace?: "push" | "pop" | undefined; - /** - * Whether you can use gestures to dismiss this screen. Defaults to `true` on iOS, `false` on Android. - * Not supported on Web. - */ - gestureEnabled?: boolean | undefined; - /** - * Object to override the distance of touch start from the edge of the screen to recognize gestures. - * Not supported on Web. - */ - gestureResponseDistance?: { - /** - * Distance for vertical direction. Defaults to 135. - */ - vertical?: number | undefined; - /** - * Distance for horizontal direction. Defaults to 25. - */ - horizontal?: number | undefined; - } | undefined; - /** - * Number which determines the relevance of velocity for the gesture. Defaults to 0.3. - * Not supported on Web. - */ - gestureVelocityImpact?: number | undefined; - /** - * Safe area insets for the screen. This is used to avoid elements like notch and status bar. - * By default, the device's safe area insets are automatically detected. You can override the behavior with this option. - * For example, to remove the extra spacing for status bar, pass `safeAreaInsets: { top: 0 }`. - */ - safeAreaInsets?: { - top?: number | undefined; - right?: number | undefined; - bottom?: number | undefined; - left?: number | undefined; - } | undefined; - /** - * Whether to detach the previous screen from the view hierarchy to save memory. - * Set it to `false` if you need the previous screen to be seen through the active screen. - * Only applicable if `detachInactiveScreens` isn't set to `false`. - * Defaults to `false` for the last screen when mode='modal', otherwise `true`. - */ - detachPreviousScreen?: boolean | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackNavigationConfig = { - mode?: StackCardMode | undefined; - headerMode?: StackHeaderMode | undefined; - /** - * If `false`, the keyboard will NOT automatically dismiss when navigating to a new screen. - * Defaults to `true`. - */ - keyboardHandlingEnabled?: boolean | undefined; - /** - * Whether inactive screens should be detached from the view hierarchy to save memory. - * Make sure to call `enableScreens` from `react-native-screens` to make it work. - * Defaults to `true` on Android, depends on the version of `react-native-screens` on iOS. - */ - detachInactiveScreens?: boolean | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackHeaderLeftButtonProps = { - /** - * Whether the button is disabled. - */ - disabled?: boolean | undefined; - /** - * Callback to call when the button is pressed. - * By default, this triggers `goBack`. - */ - onPress?: (() => void) | undefined; - /** - * Color for material ripple (Android >= 5.0 only). - */ - pressColorAndroid?: string | undefined; - /** - * Function which returns a React Element to display custom image in header's back button. - */ - backImage?: - | ((props: { - tintColor: string; - }) => React.ReactNode) - | undefined; - /** - * Tint color for the header. - */ - tintColor?: string | undefined; - /** - * Label text for the button. Usually the title of the previous screen. - * By default, this is only shown on iOS. - */ - label?: string | undefined; - /** - * Label text to show when there isn't enough space for the full label. - */ - truncatedLabel?: string | undefined; - /** - * Whether the label text is visible. - * Defaults to `true` on iOS and `false` on Android. - */ - labelVisible?: boolean | undefined; - /** - * Style object for the label. - */ - labelStyle?: Animated.WithAnimatedValue> | undefined; - /** - * Whether label font should scale to respect Text Size accessibility settings. - */ - allowFontScaling?: boolean | undefined; - /** - * Callback to trigger when the size of the label changes. - */ - onLabelLayout?: ((e: LayoutChangeEvent) => void) | undefined; - /** - * Layout of the screen. - */ - screenLayout?: Layout | undefined; - /** - * Layout of the title element in the header. - */ - titleLayout?: Layout | undefined; - /** - * Whether it's possible to navigate back in stack. - */ - canGoBack?: boolean | undefined; - /** - * Accessibility label for the button for screen readers. - */ - accessibilityLabel?: string | undefined; - /** - * Style object for the button. - */ - style?: StyleProp | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackHeaderTitleProps = { - /** - * Callback to trigger when the size of the title element changes. - */ - onLayout: (e: LayoutChangeEvent) => void; - /** - * Whether title font should scale to respect Text Size accessibility settings. - */ - allowFontScaling?: boolean | undefined; - /** - * Tint color for the header. - */ - tintColor?: string | undefined; - /** - * Content of the title element. Usually the title string. - */ - children?: string | undefined; - /** - * Style object for the title element. - */ - style?: Animated.WithAnimatedValue> | undefined; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type TransitionSpec = { - animation: "spring"; - config: Omit; -} | { - animation: "timing"; - config: Omit; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackCardInterpolationProps = { - /** - * Values for the current screen. - */ - current: { - /** - * Animated node representing the progress value of the current screen. - */ - progress: Animated.AnimatedInterpolation; - }; - /** - * Values for the current screen the screen after this one in the stack. - * This can be `undefined` in case the screen animating is the last one. - */ - next?: { - /** - * Animated node representing the progress value of the next screen. - */ - progress: Animated.AnimatedInterpolation; - } | undefined; - /** - * The index of the card in the stack. - */ - index: number; - /** - * Animated node representing whether the card is closing (1 - closing, 0 - not closing). - */ - closing: Animated.AnimatedInterpolation; - /** - * Animated node representing whether the card is being swiped (1 - swiping, 0 - not swiping). - */ - swiping: Animated.AnimatedInterpolation; - /** - * Animated node representing multiplier when direction is inverted (-1 - inverted, 1 - normal). - */ - inverted: Animated.AnimatedInterpolation; - /** - * Layout measurements for various items we use for animation. - */ - layouts: { - /** - * Layout of the whole screen. - */ - screen: Layout; - }; - /** - * Safe area insets - */ - insets: { - top: number; - right: number; - bottom: number; - left: number; - }; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackCardInterpolatedStyle = { - /** - * Interpolated style for the container view wrapping the card. - */ - containerStyle?: any; - /** - * Interpolated style for the view representing the card. - */ - cardStyle?: any; - /** - * Interpolated style for the view representing the semi-transparent overlay below the card. - */ - overlayStyle?: any; - /** - * Interpolated style representing the card shadow. - */ - shadowStyle?: any; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackCardStyleInterpolator = (props: StackCardInterpolationProps) => StackCardInterpolatedStyle; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackHeaderInterpolationProps = { - /** - * Values for the current screen (the screen which owns this header). - */ - current: { - /** - * Animated node representing the progress value of the current screen. - */ - progress: Animated.AnimatedInterpolation; - }; - /** - * Values for the current screen the screen after this one in the stack. - * This can be `undefined` in case the screen animating is the last one. - */ - next?: { - /** - * Animated node representing the progress value of the next screen. - */ - progress: Animated.AnimatedInterpolation; - } | undefined; - /** - * Layout measurements for various items we use for animation. - */ - layouts: { - /** - * Layout of the header - */ - header: Layout; - /** - * Layout of the whole screen. - */ - screen: Layout; - /** - * Layout of the title element. - */ - title?: Layout | undefined; - /** - * Layout of the back button label. - */ - leftLabel?: Layout | undefined; - }; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackHeaderInterpolatedStyle = { - /** - * Interpolated style for the label of the left button (back button label). - */ - leftLabelStyle?: any; - /** - * Interpolated style for the left button (usually the back button). - */ - leftButtonStyle?: any; - /** - * Interpolated style for the right button. - */ - rightButtonStyle?: any; - /** - * Interpolated style for the header title text. - */ - titleStyle?: any; - /** - * Interpolated style for the header background. - */ - backgroundStyle?: any; -}; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type StackHeaderStyleInterpolator = ( - props: StackHeaderInterpolationProps, -) => StackHeaderInterpolatedStyle; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -export declare type TransitionPreset = { - /** - * The direction of swipe gestures, `horizontal` or `vertical`. - */ - gestureDirection: GestureDirection; - /** - * Object which specifies the animation type (timing or spring) and their options (such as duration for timing). - */ - transitionSpec: { - /** - * Transition configuration when adding a screen. - */ - open: TransitionSpec; - /** - * Transition configuration when removing a screen. - */ - close: TransitionSpec; - }; - /** - * Function which specifies interpolated styles for various parts of the card, e.g. the overlay, shadow etc. - */ - cardStyleInterpolator: StackCardStyleInterpolator; - /** - * Function which specifies interpolated styles for various parts of the header, e.g. the title, left button etc. - */ - headerStyleInterpolator: StackHeaderStyleInterpolator; -}; diff --git a/types/tuya-panel-kit/@react-navigation/stack/utils/CardAnimationContext.d.ts b/types/tuya-panel-kit/@react-navigation/stack/utils/CardAnimationContext.d.ts deleted file mode 100644 index 5ff8bd7d11e563..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/utils/CardAnimationContext.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as React from "react"; -import type { StackCardInterpolationProps } from "../types"; -declare const _default: React.Context; -export default _default; diff --git a/types/tuya-panel-kit/@react-navigation/stack/utils/GestureHandlerRefContext.d.ts b/types/tuya-panel-kit/@react-navigation/stack/utils/GestureHandlerRefContext.d.ts deleted file mode 100644 index c4fea8d14309d7..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/utils/GestureHandlerRefContext.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -import * as React from "react"; -declare const _default: React.Context>; -export default _default; diff --git a/types/tuya-panel-kit/@react-navigation/stack/utils/HeaderHeightContext.d.ts b/types/tuya-panel-kit/@react-navigation/stack/utils/HeaderHeightContext.d.ts deleted file mode 100644 index ff65f6912b71f6..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/utils/HeaderHeightContext.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as React from "react"; -declare const _default: React.Context; -export default _default; diff --git a/types/tuya-panel-kit/@react-navigation/stack/utils/useCardAnimation.d.ts b/types/tuya-panel-kit/@react-navigation/stack/utils/useCardAnimation.d.ts deleted file mode 100644 index 2b6ad59bee2f88..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/utils/useCardAnimation.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function useCardAnimation(): import("..").StackCardInterpolationProps; diff --git a/types/tuya-panel-kit/@react-navigation/stack/utils/useGestureHandlerRef.d.ts b/types/tuya-panel-kit/@react-navigation/stack/utils/useGestureHandlerRef.d.ts deleted file mode 100644 index 517d54a427c7e0..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/utils/useGestureHandlerRef.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import * as React from "react"; -export default function useGestureHandlerRef(): React.Ref; diff --git a/types/tuya-panel-kit/@react-navigation/stack/utils/useHeaderHeight.d.ts b/types/tuya-panel-kit/@react-navigation/stack/utils/useHeaderHeight.d.ts deleted file mode 100644 index 2f16e71f8f0a85..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/utils/useHeaderHeight.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function useFloatingHeaderHeight(): number; diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Header/Header.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Header/Header.d.ts deleted file mode 100644 index bf44fab3fb854d..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Header/Header.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as React from "react"; -import type { StackHeaderProps } from "../../types"; -declare const _default: React.NamedExoticComponent; -export default _default; diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts deleted file mode 100644 index 204e27df53184b..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { JSX } from "react"; -import type { StackHeaderLeftButtonProps } from "../../types"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Props = StackHeaderLeftButtonProps; -export default function HeaderBackButton( - { - disabled, - allowFontScaling, - backImage, - label, - labelStyle, - labelVisible, - onLabelLayout, - onPress, - pressColorAndroid: customPressColorAndroid, - screenLayout, - tintColor: customTintColor, - titleLayout, - truncatedLabel, - accessibilityLabel, - style, - }: Props, -): JSX.Element; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackground.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackground.d.ts deleted file mode 100644 index 515f216e2e9fce..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackground.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as React from "react"; -import { Animated, StyleProp, ViewProps, ViewStyle } from "react-native"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Props = ViewProps & { - style?: Animated.WithAnimatedValue> | undefined; - children?: React.ReactNode | undefined; -}; -export default function HeaderBackground({ style, ...rest }: Props): React.JSX.Element; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts deleted file mode 100644 index ab71884683ec2c..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { JSX } from "react"; -import { Animated, StyleProp, TextProps, TextStyle } from "react-native"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Props = Omit & { - tintColor?: string | undefined; - children?: string | undefined; - style?: Animated.WithAnimatedValue> | undefined; -}; -export default function HeaderTitle({ tintColor, style, ...rest }: Props): JSX.Element; -export {}; diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Stack/StackView.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Stack/StackView.d.ts deleted file mode 100644 index d1660923e84084..00000000000000 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Stack/StackView.d.ts +++ /dev/null @@ -1,175 +0,0 @@ -import * as React from "react"; -import { ParamListBase, Route, StackNavigationState } from "../../../native"; -import type { StackDescriptorMap, StackNavigationConfig, StackNavigationHelpers } from "../../types"; -// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers -declare type Props = StackNavigationConfig & { - state: StackNavigationState; - navigation: StackNavigationHelpers; - descriptors: StackDescriptorMap; -}; -/* eslint-disable @definitelytyped/strict-export-declare-modifiers */ -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -declare type State = { - // tslint:disable-next-line array-type - routes: Array>; - // tslint:disable-next-line array-type - previousRoutes: Array>; - previousDescriptors: StackDescriptorMap; - openingRouteKeys: string[]; - closingRouteKeys: string[]; - replacingRouteKeys: string[]; - descriptors: StackDescriptorMap; -}; -export default class StackView extends React.Component { - static getDerivedStateFromProps(props: Readonly, state: Readonly): { - // tslint:disable-next-line no-redundant-undefined array-type use-default-type-parameter - routes: Array>; - // tslint:disable-next-line no-redundant-undefined array-type use-default-type-parameter - previousRoutes: Array>; - descriptors: StackDescriptorMap; - previousDescriptors: StackDescriptorMap; - openingRouteKeys?: undefined; - closingRouteKeys?: undefined; - replacingRouteKeys?: undefined; - } | { - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - state?: - | Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & any - >; - type: string; - stale: false; - }> - | import("../../../native").PartialState< - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & any - >; - type: string; - stale: false; - // tslint:disable-next-line no-redundant-undefined - }> - > - | undefined; - } - >; - // tslint:disable-next-line array-type - previousRoutes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & { - state?: - | Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & any - >; - type: string; - stale: false; - }> - | import("../../../native").PartialState< - Readonly<{ - key: string; - index: number; - routeNames: string[]; - // tslint:disable-next-line no-redundant-undefined - history?: unknown[] | undefined; - // tslint:disable-next-line array-type - routes: Array< - & Readonly<{ - key: string; - name: string; - }> - & Readonly<{ - // tslint:disable-next-line no-redundant-undefined - params?: object | undefined; - }> - & any - >; - type: string; - stale: false; - // tslint:disable-next-line no-redundant-undefined - }> - > - | undefined; - } - >; - previousDescriptors: StackDescriptorMap; - openingRouteKeys: string[]; - closingRouteKeys: string[]; - replacingRouteKeys: string[]; - descriptors: StackDescriptorMap; - }; - state: State; - private getGesturesEnabled; - private getPreviousRoute; - private renderScene; - private renderHeader; - private handleOpenRoute; - private handleCloseRoute; - private handleTransitionStart; - private handleTransitionEnd; - private handleGestureStart; - private handleGestureEnd; - private handleGestureCancel; - render(): React.JSX.Element; -} -export {}; diff --git a/types/tuya-panel-kit/index.d.ts b/types/tuya-panel-kit/index.d.ts index fca4bf5f8d7f1e..598f7887acc17d 100644 --- a/types/tuya-panel-kit/index.d.ts +++ b/types/tuya-panel-kit/index.d.ts @@ -1,3 +1,6 @@ +import { NavigationContainerProps, NavigationContainerRef, ParamListBase, RouteProp } from "@react-navigation/native"; +import { StackNavigationOptions } from "@react-navigation/stack"; +import { TransitionPreset } from "@react-navigation/stack/lib/typescript/src/types"; import * as React from "react"; import { FlatListProps, @@ -21,9 +24,6 @@ import { ViewProps, ViewStyle, } from "react-native"; -import { NavigationContainerProps, NavigationContainerRef, ParamListBase, RouteProp } from "./@react-navigation/native"; -import { StackNavigationOptions } from "./@react-navigation/stack"; -import { TransitionPreset } from "./@react-navigation/stack/types"; import { BackgroundProps, GlobalTheme, LinearGradientBackground, RadialGradientBackground, StopsProps } from "./theme"; export { GlobalTheme } from "./theme"; diff --git a/types/tuya-panel-kit/package.json b/types/tuya-panel-kit/package.json index 6d234c7f98053a..05df38923e7e0b 100644 --- a/types/tuya-panel-kit/package.json +++ b/types/tuya-panel-kit/package.json @@ -6,6 +6,8 @@ "https://github.com/TuyaInc/tuya-panel-kit#readme" ], "dependencies": { + "@react-navigation/native": "5.7.3", + "@react-navigation/stack": "5.9.0", "@types/react": "^17", "@types/react-native": "^0.65", "react-native-gesture-handler": "1.8.0", diff --git a/types/verovio/VerovioOptions.d.ts b/types/verovio/VerovioOptions.d.ts index ea0d84a0b8058f..85552bc3efe49c 100644 --- a/types/verovio/VerovioOptions.d.ts +++ b/types/verovio/VerovioOptions.d.ts @@ -1870,6 +1870,13 @@ export interface VerovioOptions { */ ligatureAsBracket?: boolean; + /** + * Ligature oblique shape + * + * default: "auto" + */ + ligatureOblique?: "auto" | "straight" | "curved"; + /** * Convert mensural content to a more responsive view reduced to the seleceted markup * diff --git a/types/verovio/index.d.ts b/types/verovio/index.d.ts index fa6965022e8c46..f13f1eaefe885a 100644 --- a/types/verovio/index.d.ts +++ b/types/verovio/index.d.ts @@ -16,9 +16,13 @@ export interface GetMeiOptions { */ pageNo?: number; /** - * default true + * Score Based, default true */ scoreBased?: boolean; + /** + * Basic, default false + */ + basic?: boolean; /** * remove all @xml:id not used in the data; default false */ @@ -31,6 +35,50 @@ export interface TimeMapEntry { off?: string[]; tempo?: number; } +export interface RedoLayoutOptions { + /** + * true by default + */ + resetCache?: boolean; +} +export interface TimeMapOptions { + /** + * Include measures in the timemap (false by default) + */ + includeMeasures?: boolean; + /** + * Include rests in the timemap (false by default) + */ + includeRests?: boolean; +} +export interface Selection { + measureRange?: string; + start?: string; + end?: string; +} +export interface PAEValidationMessage { + column: number; + row: number; + code: number; + text: string; + type: "error" | "warning"; +} +export interface PAEValidation { + clef?: PAEValidationMessage; + data?: PAEValidationMessage[]; +} +interface ExpansionMap { + [key: string]: any; +} +export interface DescriptiveFeatures { + intervalsChromatic: string[]; + intervalsDiatonic: string[]; + intervalsIds: string[]; + pitchesChromatic: string[]; + pitchesDiatonic: string[]; + pitchesIds: string[]; +} +type DescriptiveFeaturesOptions = unknown; export const module: VerovioModule; export interface VerovioModule { @@ -48,14 +96,36 @@ export interface VerovioModule { export class toolkit { constructor(module?: VerovioModule); + destroy: () => void; /** - * Edit the MEI data. + * Filter Humdrum data. + * @returns The Humdrum data as a string + */ + convertHumdrumToHumdrum: (humdrumData: string) => string; + + /** + * Convert Humdrum data to MIDI. + * @returns The MIDI file as a base64-encoded string + */ + convertHumdrumToMIDI: (humdrumData: string) => string; + + /** + * Convert MEI data into Humdrum data. + * @returns The Humdrum data as a string + */ + convertMEIToHumdrum: (mei: string) => string; + + /** + * Edit the MEI data - experimental code not to rely on. + * @param editorAction The editor actions as a stringified JSON object + * @returns True if the edit action was successfully applied */ edit: (editorAction: EditorAction) => boolean; /** - * Return the editor status. + * Return the editor status - experimental code not to rely on. + * @returns The editor status as a string */ editInfo: () => EditorAction; @@ -67,39 +137,57 @@ export class toolkit { getAvailableOptions: () => AvailableOptions; /** - * Returns array of IDs of elements being currently played. - * @returns A JSON object with the page and notes being played + * Return a dictionary of all the options with their default value. */ - getElementsAtTime: (millisec: number) => { notes: string[]; page: number }; + getDefaultOptions: () => VerovioOptions; + + /** + * Return descriptive features as a JSON string. + * + * The features are tailored for implementing incipit search. + * @param jsonOptions A JSON object with the feature extraction options + * @returns A JSON object with the requested features + */ + getDescriptiveFeatures: (jsonOptions: DescriptiveFeaturesOptions) => DescriptiveFeatures; /** * Return element attributes as a JSON string. * * The attributes returned include the ones not supported by Verovio + * @param xmlId the ID (@xml:id) of the element being looked for * @returns A JSON object with all attributes */ getElementAttr: (xmlId: string) => { [attribute: string]: string }; + /** + * Returns array of IDs of elements being currently played. + * @param millisec The time in milliseconds + * @returns A JSON object with the page and notes being played + */ + getElementsAtTime: (millisec: number) => { notes: string[]; page: number }; + /** * Returns a vector of ID strings of all elements (the notated and the expanded) for a given element. + * @param xmlId the ID (@xml:id) of the element being looked for + * @returns A JSON object with all IDs */ getExpansionIdsForElement: (xmlId: string) => { [notated: string]: string }; /** * Get the humdrum buffer. + * @returns The humdrum buffer as a string */ getHumdrum: () => string; /** - * Returns the log message of the last performed operation, for example after having called loadData. + * Get the log content for the latest operation. + * @returns The log content as a string */ getLog: () => string; /** - * Returns the MEI data loaded in the toolkit. If a page number is provided (i.e. > 0), then - * only that page is exported. In score-based MEI, then only the section element will be - * output. Set options.scoreBased to true for standard score-based MEI and false for the - * internal page-based MEI. + * Get the MEI as a string. + * @param options A JSON object with the output options; pageNo: integer; (1-based), all pages if none (or 0) specified; scoreBased: true or false; true by default; basic: true or false; false by default; removeIds: true or false; false by default - remove all @xml:id not used in the data; */ getMEI: (options?: GetMeiOptions) => string; @@ -107,18 +195,29 @@ export class toolkit { * Return MIDI values of the element with the ID (xml:id) * * RenderToMIDI() must be called prior to using this method + * @param xmlId the ID (@xml:id) of the element being looked for + * @returns a JSON object with the MIDI values */ getMIDIValuesForElement: (xmlId: string) => MIDIValues; /** * Returns the ID string of the notated (the original) element. + * @param xmlId the ID (@xml:id) of the element being looked for + * @returns An ID string */ getNotatedIdForElement: (xmlId: string) => string; + /** + * Return a dictionary of all the options with their current value. + * @returns A JSON object + */ + getOptions: (defaultValues?: boolean) => VerovioOptions; + /** * Return the number of pages in the loaded document. * * The number of pages depends one the page size and if encoded layout was taken into account or not. + * @returns The number of pages */ getPageCount: () => number; @@ -126,6 +225,8 @@ export class toolkit { * Return the page on which the element is the ID (xml:id) is rendered. * * This takes into account the current layout options. + * @param xmlId the ID (@xml:id) of the element being looked for + * @returns the page number (1-based) where the element is (0 if not found) */ getPageWithElement: (xmlId: string) => number; @@ -133,6 +234,8 @@ export class toolkit { * Return the time at which the element is the ID (xml:id) is played. * * RenderToMIDI() must be called prior to using this method. + * @param xmlId the ID (@xml:id) of the element being looked for + * @returns The time in milliseconds */ getTimeForElement: (xmlId: string) => number; @@ -140,6 +243,8 @@ export class toolkit { * Return a JSON object string with the following key values for a given note. * * Return scoreTimeOnset, scoreTimeOffset, scoreTimeTiedDuration, realTimeOnsetMilliseconds, realTimeOffsetMilliseconds, realTimeTiedDurationMilliseconds. + * @param xmlId the ID (@xml:id) of the element being looked for + * @returns A JSON object with the values */ getTimesForElement: (xmlId: string) => { scoreTimeOnset: number; @@ -152,6 +257,7 @@ export class toolkit { /** * Return the version number. + * @returns the version number as a string */ getVersion: () => string; @@ -159,18 +265,21 @@ export class toolkit { * Load a string data with the type previously specified in the options. * * By default, the methods try to auto-detect the type. + * @param data A string with the data (e.g., MEI data) to be loaded * @returns True if the data was successfully loaded */ - loadData: (meiData: string) => boolean; + loadData: (data: string) => boolean; /** * Load a MusicXML compressed file passed as base64 encoded string. + * @param zipDataBase64 A ZIP file as a base64 encoded string * @returns True if the data was successfully loaded */ loadZipDataBase64: (zipDataBase64: string) => boolean; /** * Load a MusicXML compressed file passed as a buffer of bytes. + * @param zipDataBuffer A ZIP file as a buffer of bytes * @returns True if the data was successfully loaded */ loadZipDataBuffer: (zipDataBuffer: ArrayBuffer) => boolean; @@ -179,8 +288,9 @@ export class toolkit { * Redo the layout of the loaded data. * * This can be called once the rendering option were changed, for example with a new page (sceen) height or a new zoom level. + * @param options A JSON object with the action options resetCache: true or false; true by default; */ - redoLayout: () => void; + redoLayout: (options?: RedoLayoutOptions) => void; /** * Redo the layout of the pitch postitions of the current drawing page. @@ -190,12 +300,20 @@ export class toolkit { redoPagePitchPosLayout: () => void; /** - * Loads and the data with the options passed as JSON object and renders the first page. This - * methods is a shortcut for loadData and then renderPage and is appropriate for rendering small - * data snippets. The data does stay in memory once loaded. Also, up to version 0.9.12, the JSON - * object had to be stringified. + * Render the first page of the data to SVG. + * + * This method is a wrapper for setting options, loading data and rendering the first page. It will return an empty string if the options cannot be set or the data cannot be loaded. + * @param data A string with the data (e.g., MEI data) to be loaded + * @param options A JSON object with the output options + * @returns The SVG first page as a string + */ + renderData: (data: string, options: VerovioOptions) => string; + + /** + * Render a document’s expansionMap, if existing. + * @returns The expansion map as a JSON object */ - renderData: (meiData: string, options: VerovioOptions) => string; + renderToExpansionMap: () => ExpansionMap; /** * Render the document to MIDI. @@ -204,7 +322,7 @@ export class toolkit { renderToMIDI: () => string; /** - * Render a document to Plaine and Easie. + * Render a document to Plaine and Easie code. * * Only the top staff / layer is exported. * @returns The PAE as a string @@ -212,25 +330,57 @@ export class toolkit { renderToPAE: () => string; /** - * Renders a page for the data loaded in the toolkit and returns it in SVG. The page numbering - * is 1-based. + * Render a page to SVG. + * @param pageNumber The page to render (1-based), default 1 + * @param xmlDeclaration True for including the xml declaration in the SVG output, default false * @returns The SVG page as a string */ - renderToSVG: (pageNumber: number) => string; + renderToSVG: (pageNumber?: number, xmlDeclaration?: boolean) => string; /** * Render a document to a timemap. + * @param options A stringified JSON objects with the timemap options + * @returns The timemap as a JSON object */ - renderToTimemap: () => TimeMapEntry[]; + renderToTimemap: (options?: TimeMapOptions) => TimeMapEntry[]; + /** - * Sets the options as JSON for the toolkit instance. Up to version 0.9.12, the JSON object had to be stringified. + * Reset all options to default values. */ - setOptions: (options: VerovioOptions) => void; + resetOptions: () => void; /** - * Return a dictionary of all the options. + * Reset the seed used to generate MEI @xml:id attribute values. * - * @param defaultValues True for getting the default values and false for the current values + * Passing 0 will seed the @xml:id generator with a random (time-based) seed value. This method will have no effect if the xml-id-checksum option is set. + * @param seed The seed value for generating the @xml:id values (0 for a time-based random seed) */ - getOptions: (defaultValues?: boolean) => VerovioOptions; + resetXmlIdSeed: (seed: number) => void; + + /** + * Set the value for a selection. + * + * The selection will be applied only when some data is loaded or the layout is redone. The selection can be reset (cancelled) by passing an empty string or an empty JSON object. A selection across multiple mdivs is not possible. + * @param selection The selection as a stringified object + * @returns True if the selection was successfully parsed or reset + */ + select: (selection: Selection) => boolean; + + /** + * Set option values. + * + * The name of each option to be set is to be given as JSON key. + * @param options A JSON object with the output options + * @returns True if the options were successfully set + */ + setOptions: (options: VerovioOptions) => boolean; + + /** + * Validate the Plaine & Easie code passed in the string data. + * + * A single JSON object is returned when there is a global input error. When reading the input succeeds, validation is grouped by input keys. The methods always returns errors in PAE pedantic mode. No data remains loaded after the validation. + * @param data A string with the data in JSON or with PAE @ keys + * @returns A JSON object with the validation warnings or errors + */ + validatePAE: (data: string | { [key: string]: string }) => PAEValidation; } diff --git a/types/verovio/package.json b/types/verovio/package.json index cef4c04c41475d..b68ff8ca68c4b3 100644 --- a/types/verovio/package.json +++ b/types/verovio/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/verovio", - "version": "5.0.9999", + "version": "5.1.9999", "exports": { ".": "./index.d.ts", "./esm": { diff --git a/types/verovio/verovio-tests.ts b/types/verovio/verovio-tests.ts index e0df144e44d422..8a5ff352a3950a 100644 --- a/types/verovio/verovio-tests.ts +++ b/types/verovio/verovio-tests.ts @@ -9,6 +9,7 @@ import { VerovioToolkit } from "verovio/esm"; tk.getAvailableOptions(); // $ExpectType VerovioOptions tk.getOptions(); + tk.select({}); })(); verovio.module.onRuntimeInitialized = () => { diff --git a/types/ysdk/index.d.ts b/types/ysdk/index.d.ts index d63a1d3b36ab0e..868afcb0628fb1 100644 --- a/types/ysdk/index.d.ts +++ b/types/ysdk/index.d.ts @@ -53,6 +53,7 @@ export interface SDK { getPlayer(opts?: { signed?: TSigned; + scopes?: boolean; }): Promise : Player>; feedback: {