@24i/bigscreen-sdk 1.0.15-alpha.2298 → 1.0.15-alpha.2299
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/packages/analytics/src/clients/GoogleAnalytics/constants.ts +2 -0
- package/packages/create-package/dist/createPackage.js +66 -0
- package/packages/create-package/dist/createPackage.js.map +1 -0
- package/packages/create-package/dist/index.js +5 -0
- package/packages/create-package/dist/index.js.map +1 -0
- package/packages/create-package/dist/questionnaire/questions.js +35 -0
- package/packages/create-package/dist/questionnaire/questions.js.map +1 -0
- package/packages/create-package/dist/settings/Settings.js +10 -0
- package/packages/create-package/dist/settings/Settings.js.map +1 -0
- package/packages/create-package/dist/types.js +3 -0
- package/packages/create-package/dist/types.js.map +1 -0
- package/packages/types-bigscreen-jsx/index.d.ts +50 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@24i/bigscreen-sdk",
|
|
3
|
-
"version": "1.0.15-alpha.
|
|
3
|
+
"version": "1.0.15-alpha.2299",
|
|
4
4
|
"description": "SmartApps BIGscreen SDK monorepo",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/24i/smartapps-bigscreen-sdk#readme",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@24i/appstage-shared-analytics": "1.0.
|
|
40
|
+
"@24i/appstage-shared-analytics": "1.0.15-alpha.53",
|
|
41
41
|
"@24i/appstage-shared-events-manager": "1.0.7",
|
|
42
42
|
"@24i/appstage-shared-perf-utils": "1.0.5",
|
|
43
43
|
"@24i/player-base": "6.10.0",
|
|
@@ -106,4 +106,6 @@ export const gtagPayloadParams: Record<string, string> = {
|
|
|
106
106
|
seriesTitle: `${stringParameter}.video_series_title`,
|
|
107
107
|
url: `${stringParameter}.video_url`,
|
|
108
108
|
assetId: `${stringParameter}.video_asset_id`,
|
|
109
|
+
channelNumber: `${numericParameter}.channel_number`,
|
|
110
|
+
channelTitle: `${stringParameter}.channel_title`,
|
|
109
111
|
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.main = void 0;
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const fse = require("fs-extra");
|
|
8
|
+
const chalk = require("chalk");
|
|
9
|
+
const minimist = require("minimist");
|
|
10
|
+
const questions_1 = require("./questionnaire/questions");
|
|
11
|
+
const Settings_1 = require("./settings/Settings");
|
|
12
|
+
async function isDirectoryEmpty(dirPath) {
|
|
13
|
+
const files = await fs.promises.readdir(dirPath);
|
|
14
|
+
return !files.length;
|
|
15
|
+
}
|
|
16
|
+
async function copyTemplateFiles(templateDir, targetDir) {
|
|
17
|
+
return fse.copy(templateDir, targetDir);
|
|
18
|
+
}
|
|
19
|
+
function updatePackageJsonFile(filePath, options) {
|
|
20
|
+
let data = fs.readFileSync(filePath, 'utf8');
|
|
21
|
+
const keywords = options.keywords.map((word) => `"${word}"`).join(', ');
|
|
22
|
+
data = data.replace(/("name": ")(.*)(")/, `$1${options.name}$3`);
|
|
23
|
+
data = data.replace(/("version": ")(.*)(")/, `$1${options.version}$3`);
|
|
24
|
+
data = data.replace(/("description": ")(.*)(")/, `$1${options.description}$3`);
|
|
25
|
+
data = data.replace(/("keywords": \[)(.*)(\])/, `$1${keywords}$3`);
|
|
26
|
+
data = data.replace(/("author": ")(.*)(")/, `$1${options.author}$3`);
|
|
27
|
+
fs.writeFileSync(filePath, data);
|
|
28
|
+
}
|
|
29
|
+
function parseArguments(rawArgv) {
|
|
30
|
+
const argv = minimist(rawArgv.slice(2));
|
|
31
|
+
const dirName = argv._[0];
|
|
32
|
+
if (!dirName) {
|
|
33
|
+
console.error('Error: Missing package name');
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
dirName,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async function main() {
|
|
41
|
+
const { dirName: destDirName } = parseArguments(process.argv);
|
|
42
|
+
const destDir = path.join(process.cwd(), 'packages/', destDirName);
|
|
43
|
+
if (fs.existsSync(destDir)) {
|
|
44
|
+
console.error(`Error: Target directory "${destDir}" already exists`);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
48
|
+
const isDirEmpty = await isDirectoryEmpty(destDir);
|
|
49
|
+
if (!isDirEmpty) {
|
|
50
|
+
console.error(`Error: Target directory "${destDir}" is not empty.`);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
const settings = Object.assign({}, Settings_1.Settings);
|
|
54
|
+
settings.name = `${Settings_1.Settings.name}${destDirName}`.toLowerCase();
|
|
55
|
+
const details = await (0, questions_1.promptPackageDetails)(settings);
|
|
56
|
+
const templateDir = path.join(__dirname, '..', 'templates/typescript');
|
|
57
|
+
await copyTemplateFiles(templateDir, destDir);
|
|
58
|
+
const packageJsonFile = path.join(destDir, 'package.json');
|
|
59
|
+
updatePackageJsonFile(packageJsonFile, details);
|
|
60
|
+
const docsSymlinkTarget = path.join('../../../packages/', destDirName, '/README.md');
|
|
61
|
+
const docsSymlinkPath = path.join(process.cwd(), 'docs/packages/', destDirName, '/README.md');
|
|
62
|
+
await fse.ensureSymlink(docsSymlinkTarget, docsSymlinkPath);
|
|
63
|
+
console.log(`${chalk.green('Success')}, package has been initialized!`);
|
|
64
|
+
}
|
|
65
|
+
exports.main = main;
|
|
66
|
+
//# sourceMappingURL=createPackage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPackage.js","sourceRoot":"","sources":["../src/createPackage.ts"],"names":[],"mappings":";;;;AAEA,6BAA6B;AAC7B,yBAAyB;AAC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,EAAC,QAAQ,CAAC,CAAC;IACrD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,sBAAsB,CAAC,CAAC;IAEvE,MAAM,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC9C,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC3D,qBAAqB,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IAGhD,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IACrF,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IAC9F,MAAM,GAAG,CAAC,aAAa,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;IAE5D,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;AAC5E,CAAC;AA/BD,oBA+BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,mDAAuC;AAEvC,IAAA,oBAAI,GAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.promptPackageDetails = void 0;
|
|
4
|
+
const inquirer = require("inquirer");
|
|
5
|
+
async function promptPackageDetails(defaultValues) {
|
|
6
|
+
return inquirer.prompt([
|
|
7
|
+
{
|
|
8
|
+
type: 'input',
|
|
9
|
+
name: 'name',
|
|
10
|
+
message: 'Package name:',
|
|
11
|
+
default: defaultValues.name,
|
|
12
|
+
}, {
|
|
13
|
+
type: 'input',
|
|
14
|
+
name: 'version',
|
|
15
|
+
message: 'Version:',
|
|
16
|
+
default: defaultValues.version,
|
|
17
|
+
}, {
|
|
18
|
+
type: 'input',
|
|
19
|
+
name: 'description',
|
|
20
|
+
message: 'Description:',
|
|
21
|
+
}, {
|
|
22
|
+
type: 'input',
|
|
23
|
+
name: 'keywords',
|
|
24
|
+
message: 'Keywords:',
|
|
25
|
+
filter: (ans) => ans.split(/[\s,]+/),
|
|
26
|
+
}, {
|
|
27
|
+
type: 'input',
|
|
28
|
+
name: 'author',
|
|
29
|
+
message: 'Author:',
|
|
30
|
+
default: defaultValues.author,
|
|
31
|
+
},
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
exports.promptPackageDetails = promptPackageDetails;
|
|
35
|
+
//# sourceMappingURL=questions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"questions.js","sourceRoot":"","sources":["../../src/questionnaire/questions.ts"],"names":[],"mappings":";;;AAAA,qCAAqC;AAWrC,KAAK,UAAU,oBAAoB,CAAC,aAA4C;IAC5E,OAAO,QAAQ,CAAC,MAAM,CAAC;QACnB;YACI,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,eAAe;YACxB,OAAO,EAAE,aAAa,CAAC,IAAI;SAC9B,EAAE;YACC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,UAAU;YACnB,OAAO,EAAE,aAAa,CAAC,OAAO;SACjC,EAAE;YACC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,cAAc;SAC1B,EAAE;YACC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,WAAW;YACpB,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC;SACvC,EAAE;YACC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,aAAa,CAAC,MAAM;SAChC;KACJ,CAAC,CAAC;AACP,CAAC;AAEQ,oDAAoB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Settings = void 0;
|
|
4
|
+
const Settings = {
|
|
5
|
+
name: '@24i/smartapps-bigscreen-',
|
|
6
|
+
version: '0.0.1',
|
|
7
|
+
author: '24i',
|
|
8
|
+
};
|
|
9
|
+
exports.Settings = Settings;
|
|
10
|
+
//# sourceMappingURL=Settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../src/settings/Settings.ts"],"names":[],"mappings":";;;AAAA,MAAM,QAAQ,GAAG;IACb,IAAI,EAAE,2BAA2B;IACjC,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,KAAK;CAChB,CAAC;AAEO,4BAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -133,9 +133,19 @@ declare namespace React {
|
|
|
133
133
|
key?: Key | null | undefined;
|
|
134
134
|
}
|
|
135
135
|
interface RefAttributes<T> extends Attributes {
|
|
136
|
+
/**
|
|
137
|
+
* Allows getting a ref to the component instance.
|
|
138
|
+
* Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref).
|
|
139
|
+
* @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom
|
|
140
|
+
*/
|
|
136
141
|
ref?: Ref<T> | undefined;
|
|
137
142
|
}
|
|
138
143
|
interface ClassAttributes<T> extends Attributes {
|
|
144
|
+
/**
|
|
145
|
+
* Allows getting a ref to the component instance.
|
|
146
|
+
* Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref).
|
|
147
|
+
* @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom
|
|
148
|
+
*/
|
|
139
149
|
ref?: LegacyRef<T> | undefined;
|
|
140
150
|
}
|
|
141
151
|
|
|
@@ -403,7 +413,7 @@ declare namespace React {
|
|
|
403
413
|
const version: string;
|
|
404
414
|
|
|
405
415
|
/**
|
|
406
|
-
* {@link https://
|
|
416
|
+
* {@link https://react.dev/reference/react/Profiler#onrender-callback Profiler API}
|
|
407
417
|
*/
|
|
408
418
|
type ProfilerOnRenderCallback = (
|
|
409
419
|
id: string,
|
|
@@ -450,7 +460,7 @@ declare namespace React {
|
|
|
450
460
|
* }
|
|
451
461
|
* ```
|
|
452
462
|
*
|
|
453
|
-
* @see https://
|
|
463
|
+
* @see https://react.dev/reference/react/Component#static-contexttype
|
|
454
464
|
*/
|
|
455
465
|
static contextType?: Context<any> | undefined;
|
|
456
466
|
|
|
@@ -467,14 +477,14 @@ declare namespace React {
|
|
|
467
477
|
* declare context: React.ContextType<typeof MyContext>
|
|
468
478
|
* ```
|
|
469
479
|
*
|
|
470
|
-
* @see https://
|
|
480
|
+
* @see https://react.dev/reference/react/Component#context
|
|
471
481
|
*/
|
|
472
482
|
context: unknown;
|
|
473
483
|
|
|
474
484
|
constructor(props: Readonly<P> | P);
|
|
475
485
|
/**
|
|
476
486
|
* @deprecated
|
|
477
|
-
* @see https://reactjs.org/docs/legacy-context.html
|
|
487
|
+
* @see https://legacy.reactjs.org/docs/legacy-context.html
|
|
478
488
|
*/
|
|
479
489
|
constructor(props: P, context: any);
|
|
480
490
|
|
|
@@ -493,7 +503,7 @@ declare namespace React {
|
|
|
493
503
|
state: Readonly<S>;
|
|
494
504
|
/**
|
|
495
505
|
* @deprecated
|
|
496
|
-
* https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
|
|
506
|
+
* https://legacy.reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
|
|
497
507
|
*/
|
|
498
508
|
refs: {
|
|
499
509
|
[key: string]: ReactInstance
|
|
@@ -669,8 +679,8 @@ declare namespace React {
|
|
|
669
679
|
* prevents this from being invoked.
|
|
670
680
|
*
|
|
671
681
|
* @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17
|
|
672
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
|
673
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
682
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
|
683
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
674
684
|
*/
|
|
675
685
|
componentWillMount?(): void;
|
|
676
686
|
/**
|
|
@@ -683,8 +693,8 @@ declare namespace React {
|
|
|
683
693
|
* prevents this from being invoked.
|
|
684
694
|
*
|
|
685
695
|
* @deprecated 16.3, use componentDidMount or the constructor instead
|
|
686
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
|
687
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
696
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
|
|
697
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
688
698
|
*/
|
|
689
699
|
UNSAFE_componentWillMount?(): void;
|
|
690
700
|
/**
|
|
@@ -698,8 +708,8 @@ declare namespace React {
|
|
|
698
708
|
* prevents this from being invoked.
|
|
699
709
|
*
|
|
700
710
|
* @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
|
|
701
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
|
702
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
711
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
|
712
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
703
713
|
*/
|
|
704
714
|
componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
|
|
705
715
|
/**
|
|
@@ -715,8 +725,8 @@ declare namespace React {
|
|
|
715
725
|
* prevents this from being invoked.
|
|
716
726
|
*
|
|
717
727
|
* @deprecated 16.3, use static getDerivedStateFromProps instead
|
|
718
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
|
719
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
728
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
|
|
729
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
720
730
|
*/
|
|
721
731
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
|
|
722
732
|
/**
|
|
@@ -728,8 +738,8 @@ declare namespace React {
|
|
|
728
738
|
* prevents this from being invoked.
|
|
729
739
|
*
|
|
730
740
|
* @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
|
|
731
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
|
732
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
741
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
|
742
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
733
743
|
*/
|
|
734
744
|
componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
|
|
735
745
|
/**
|
|
@@ -743,8 +753,8 @@ declare namespace React {
|
|
|
743
753
|
* prevents this from being invoked.
|
|
744
754
|
*
|
|
745
755
|
* @deprecated 16.3, use getSnapshotBeforeUpdate instead
|
|
746
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
|
747
|
-
* @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
756
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
|
|
757
|
+
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
|
|
748
758
|
*/
|
|
749
759
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
|
|
750
760
|
}
|
|
@@ -887,14 +897,14 @@ declare namespace React {
|
|
|
887
897
|
* context value, as given by the nearest context provider for the given context.
|
|
888
898
|
*
|
|
889
899
|
* @version 16.8.0
|
|
890
|
-
* @see https://
|
|
900
|
+
* @see https://react.dev/reference/react/useContext
|
|
891
901
|
*/
|
|
892
902
|
function useContext<T>(context: Context<T>/*, (not public API) observedBits?: number|boolean */): T;
|
|
893
903
|
/**
|
|
894
904
|
* Returns a stateful value, and a function to update it.
|
|
895
905
|
*
|
|
896
906
|
* @version 16.8.0
|
|
897
|
-
* @see https://
|
|
907
|
+
* @see https://react.dev/reference/react/useState
|
|
898
908
|
*/
|
|
899
909
|
function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
|
|
900
910
|
// convenience overload when first argument is omitted
|
|
@@ -902,7 +912,7 @@ declare namespace React {
|
|
|
902
912
|
* Returns a stateful value, and a function to update it.
|
|
903
913
|
*
|
|
904
914
|
* @version 16.8.0
|
|
905
|
-
* @see https://
|
|
915
|
+
* @see https://react.dev/reference/react/useState
|
|
906
916
|
*/
|
|
907
917
|
function useState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
|
908
918
|
/**
|
|
@@ -913,7 +923,7 @@ declare namespace React {
|
|
|
913
923
|
* updates because you can pass `dispatch` down instead of callbacks.
|
|
914
924
|
*
|
|
915
925
|
* @version 16.8.0
|
|
916
|
-
* @see https://
|
|
926
|
+
* @see https://react.dev/reference/react/useReducer
|
|
917
927
|
*/
|
|
918
928
|
// overload where dispatch could accept 0 arguments.
|
|
919
929
|
function useReducer<R extends ReducerWithoutAction<any>, I>(
|
|
@@ -929,7 +939,7 @@ declare namespace React {
|
|
|
929
939
|
* updates because you can pass `dispatch` down instead of callbacks.
|
|
930
940
|
*
|
|
931
941
|
* @version 16.8.0
|
|
932
|
-
* @see https://
|
|
942
|
+
* @see https://react.dev/reference/react/useReducer
|
|
933
943
|
*/
|
|
934
944
|
// overload where dispatch could accept 0 arguments.
|
|
935
945
|
function useReducer<R extends ReducerWithoutAction<any>>(
|
|
@@ -945,7 +955,7 @@ declare namespace React {
|
|
|
945
955
|
* updates because you can pass `dispatch` down instead of callbacks.
|
|
946
956
|
*
|
|
947
957
|
* @version 16.8.0
|
|
948
|
-
* @see https://
|
|
958
|
+
* @see https://react.dev/reference/react/useReducer
|
|
949
959
|
*/
|
|
950
960
|
// overload where "I" may be a subset of ReducerState<R>; used to provide autocompletion.
|
|
951
961
|
// If "I" matches ReducerState<R> exactly then the last overload will allow initializer to be omitted.
|
|
@@ -963,7 +973,7 @@ declare namespace React {
|
|
|
963
973
|
* updates because you can pass `dispatch` down instead of callbacks.
|
|
964
974
|
*
|
|
965
975
|
* @version 16.8.0
|
|
966
|
-
* @see https://
|
|
976
|
+
* @see https://react.dev/reference/react/useReducer
|
|
967
977
|
*/
|
|
968
978
|
// overload for free "I"; all goes as long as initializer converts it into "ReducerState<R>".
|
|
969
979
|
function useReducer<R extends Reducer<any, any>, I>(
|
|
@@ -979,7 +989,7 @@ declare namespace React {
|
|
|
979
989
|
* updates because you can pass `dispatch` down instead of callbacks.
|
|
980
990
|
*
|
|
981
991
|
* @version 16.8.0
|
|
982
|
-
* @see https://
|
|
992
|
+
* @see https://react.dev/reference/react/useReducer
|
|
983
993
|
*/
|
|
984
994
|
|
|
985
995
|
// I'm not sure if I keep this 2-ary or if I make it (2,3)-ary; it's currently (2,3)-ary.
|
|
@@ -1004,7 +1014,7 @@ declare namespace React {
|
|
|
1004
1014
|
* value around similar to how you’d use instance fields in classes.
|
|
1005
1015
|
*
|
|
1006
1016
|
* @version 16.8.0
|
|
1007
|
-
* @see https://
|
|
1017
|
+
* @see https://react.dev/reference/react/useRef
|
|
1008
1018
|
*/
|
|
1009
1019
|
function useRef<T>(initialValue: T): MutableRefObject<T>;
|
|
1010
1020
|
// convenience overload for refs given as a ref prop as they typically start with a null value
|
|
@@ -1019,7 +1029,7 @@ declare namespace React {
|
|
|
1019
1029
|
* of the generic argument.
|
|
1020
1030
|
*
|
|
1021
1031
|
* @version 16.8.0
|
|
1022
|
-
* @see https://
|
|
1032
|
+
* @see https://react.dev/reference/react/useRef
|
|
1023
1033
|
*/
|
|
1024
1034
|
function useRef<T>(initialValue: T|null): RefObject<T>;
|
|
1025
1035
|
// convenience overload for potentially undefined initialValue / call with 0 arguments
|
|
@@ -1032,7 +1042,7 @@ declare namespace React {
|
|
|
1032
1042
|
* value around similar to how you’d use instance fields in classes.
|
|
1033
1043
|
*
|
|
1034
1044
|
* @version 16.8.0
|
|
1035
|
-
* @see https://
|
|
1045
|
+
* @see https://react.dev/reference/react/useRef
|
|
1036
1046
|
*/
|
|
1037
1047
|
function useRef<T = undefined>(): MutableRefObject<T | undefined>;
|
|
1038
1048
|
/**
|
|
@@ -1046,7 +1056,7 @@ declare namespace React {
|
|
|
1046
1056
|
* `componentDidMount` and `componentDidUpdate`.
|
|
1047
1057
|
*
|
|
1048
1058
|
* @version 16.8.0
|
|
1049
|
-
* @see https://
|
|
1059
|
+
* @see https://react.dev/reference/react/useLayoutEffect
|
|
1050
1060
|
*/
|
|
1051
1061
|
function useLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;
|
|
1052
1062
|
/**
|
|
@@ -1056,7 +1066,7 @@ declare namespace React {
|
|
|
1056
1066
|
* @param deps If present, effect will only activate if the values in the list change.
|
|
1057
1067
|
*
|
|
1058
1068
|
* @version 16.8.0
|
|
1059
|
-
* @see https://
|
|
1069
|
+
* @see https://react.dev/reference/react/useEffect
|
|
1060
1070
|
*/
|
|
1061
1071
|
function useEffect(effect: EffectCallback, deps?: DependencyList): void;
|
|
1062
1072
|
// NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref<T>
|
|
@@ -1067,7 +1077,7 @@ declare namespace React {
|
|
|
1067
1077
|
* `useImperativeHandle` should be used with `React.forwardRef`.
|
|
1068
1078
|
*
|
|
1069
1079
|
* @version 16.8.0
|
|
1070
|
-
* @see https://
|
|
1080
|
+
* @see https://react.dev/reference/react/useImperativeHandle
|
|
1071
1081
|
*/
|
|
1072
1082
|
function useImperativeHandle<T, R extends T>(ref: Ref<T>|undefined, init: () => R, deps?: DependencyList): void;
|
|
1073
1083
|
// I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key
|
|
@@ -1077,7 +1087,7 @@ declare namespace React {
|
|
|
1077
1087
|
* has changed.
|
|
1078
1088
|
*
|
|
1079
1089
|
* @version 16.8.0
|
|
1080
|
-
* @see https://
|
|
1090
|
+
* @see https://react.dev/reference/react/useCallback
|
|
1081
1091
|
*/
|
|
1082
1092
|
// A specific function type would not trigger implicit any.
|
|
1083
1093
|
// See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/52873#issuecomment-845806435 for a comparison between `Function` and more specific types.
|
|
@@ -1087,7 +1097,7 @@ declare namespace React {
|
|
|
1087
1097
|
* `useMemo` will only recompute the memoized value when one of the `deps` has changed.
|
|
1088
1098
|
*
|
|
1089
1099
|
* @version 16.8.0
|
|
1090
|
-
* @see https://
|
|
1100
|
+
* @see https://react.dev/reference/react/useMemo
|
|
1091
1101
|
*/
|
|
1092
1102
|
// allow undefined, but don't make it optional as that is very likely a mistake
|
|
1093
1103
|
function useMemo<T>(factory: () => T, deps: DependencyList | undefined): T;
|
|
@@ -1098,7 +1108,7 @@ declare namespace React {
|
|
|
1098
1108
|
* It’s most valuable for custom hooks that are part of shared libraries.
|
|
1099
1109
|
*
|
|
1100
1110
|
* @version 16.8.0
|
|
1101
|
-
* @see https://
|
|
1111
|
+
* @see https://react.dev/reference/react/useDebugValue
|
|
1102
1112
|
*/
|
|
1103
1113
|
// the name of the custom hook is itself derived from the function name at runtime:
|
|
1104
1114
|
// it's just the function name without the "use" prefix.
|
|
@@ -1128,7 +1138,7 @@ declare namespace React {
|
|
|
1128
1138
|
*
|
|
1129
1139
|
* @param value The value that is going to be deferred
|
|
1130
1140
|
*
|
|
1131
|
-
* @see https://
|
|
1141
|
+
* @see https://react.dev/reference/react/useDeferredValue
|
|
1132
1142
|
*/
|
|
1133
1143
|
export function useDeferredValue<T>(value: T): T;
|
|
1134
1144
|
|
|
@@ -1145,7 +1155,7 @@ declare namespace React {
|
|
|
1145
1155
|
*
|
|
1146
1156
|
* **If some state update causes a component to suspend, that state update should be wrapped in a transition.**`
|
|
1147
1157
|
*
|
|
1148
|
-
* @see https://
|
|
1158
|
+
* @see https://react.dev/reference/react/useTransition
|
|
1149
1159
|
*/
|
|
1150
1160
|
export function useTransition(): [boolean, TransitionStartFunction];
|
|
1151
1161
|
|
|
@@ -1855,6 +1865,7 @@ declare namespace React {
|
|
|
1855
1865
|
|
|
1856
1866
|
// Standard HTML Attributes
|
|
1857
1867
|
accessKey?: string | undefined;
|
|
1868
|
+
autoFocus?: boolean | undefined;
|
|
1858
1869
|
className?: string | undefined;
|
|
1859
1870
|
contentEditable?: Booleanish | "inherit" | undefined;
|
|
1860
1871
|
contextMenu?: string | undefined;
|
|
@@ -1880,11 +1891,14 @@ declare namespace React {
|
|
|
1880
1891
|
|
|
1881
1892
|
// RDFa Attributes
|
|
1882
1893
|
about?: string | undefined;
|
|
1894
|
+
content?: string | undefined;
|
|
1883
1895
|
datatype?: string | undefined;
|
|
1884
1896
|
inlist?: any;
|
|
1885
1897
|
prefix?: string | undefined;
|
|
1886
1898
|
property?: string | undefined;
|
|
1899
|
+
rel?: string | undefined;
|
|
1887
1900
|
resource?: string | undefined;
|
|
1901
|
+
rev?: string | undefined;
|
|
1888
1902
|
typeof?: string | undefined;
|
|
1889
1903
|
vocab?: string | undefined;
|
|
1890
1904
|
|
|
@@ -1926,7 +1940,6 @@ declare namespace React {
|
|
|
1926
1940
|
as?: string | undefined;
|
|
1927
1941
|
async?: boolean | undefined;
|
|
1928
1942
|
autoComplete?: string | undefined;
|
|
1929
|
-
autoFocus?: boolean | undefined;
|
|
1930
1943
|
autoPlay?: boolean | undefined;
|
|
1931
1944
|
capture?: boolean | 'user' | 'environment' | undefined;
|
|
1932
1945
|
cellPadding?: number | string | undefined;
|
|
@@ -1938,7 +1951,6 @@ declare namespace React {
|
|
|
1938
1951
|
classID?: string | undefined;
|
|
1939
1952
|
cols?: number | undefined;
|
|
1940
1953
|
colSpan?: number | undefined;
|
|
1941
|
-
content?: string | undefined;
|
|
1942
1954
|
controls?: boolean | undefined;
|
|
1943
1955
|
coords?: string | undefined;
|
|
1944
1956
|
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
@@ -1993,7 +2005,6 @@ declare namespace React {
|
|
|
1993
2005
|
poster?: string | undefined;
|
|
1994
2006
|
preload?: string | undefined;
|
|
1995
2007
|
readOnly?: boolean | undefined;
|
|
1996
|
-
rel?: string | undefined;
|
|
1997
2008
|
required?: boolean | undefined;
|
|
1998
2009
|
reversed?: boolean | undefined;
|
|
1999
2010
|
rows?: number | undefined;
|
|
@@ -2048,7 +2059,6 @@ declare namespace React {
|
|
|
2048
2059
|
hrefLang?: string | undefined;
|
|
2049
2060
|
media?: string | undefined;
|
|
2050
2061
|
ping?: string | undefined;
|
|
2051
|
-
rel?: string | undefined;
|
|
2052
2062
|
target?: HTMLAttributeAnchorTarget | undefined;
|
|
2053
2063
|
type?: string | undefined;
|
|
2054
2064
|
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
|
|
@@ -2064,7 +2074,6 @@ declare namespace React {
|
|
|
2064
2074
|
hrefLang?: string | undefined;
|
|
2065
2075
|
media?: string | undefined;
|
|
2066
2076
|
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
|
|
2067
|
-
rel?: string | undefined;
|
|
2068
2077
|
shape?: string | undefined;
|
|
2069
2078
|
target?: string | undefined;
|
|
2070
2079
|
}
|
|
@@ -2079,7 +2088,6 @@ declare namespace React {
|
|
|
2079
2088
|
}
|
|
2080
2089
|
|
|
2081
2090
|
interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
2082
|
-
autoFocus?: boolean | undefined;
|
|
2083
2091
|
disabled?: boolean | undefined;
|
|
2084
2092
|
form?: string | undefined;
|
|
2085
2093
|
formAction?: string | undefined;
|
|
@@ -2148,7 +2156,6 @@ declare namespace React {
|
|
|
2148
2156
|
name?: string | undefined;
|
|
2149
2157
|
noValidate?: boolean | undefined;
|
|
2150
2158
|
target?: string | undefined;
|
|
2151
|
-
rel?: string | undefined;
|
|
2152
2159
|
}
|
|
2153
2160
|
|
|
2154
2161
|
interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
@@ -2226,7 +2233,6 @@ declare namespace React {
|
|
|
2226
2233
|
accept?: string | undefined;
|
|
2227
2234
|
alt?: string | undefined;
|
|
2228
2235
|
autoComplete?: string | undefined;
|
|
2229
|
-
autoFocus?: boolean | undefined;
|
|
2230
2236
|
capture?: boolean | 'user' | 'environment' | undefined; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
|
|
2231
2237
|
checked?: boolean | undefined;
|
|
2232
2238
|
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
@@ -2261,7 +2267,6 @@ declare namespace React {
|
|
|
2261
2267
|
}
|
|
2262
2268
|
|
|
2263
2269
|
interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
2264
|
-
autoFocus?: boolean | undefined;
|
|
2265
2270
|
challenge?: string | undefined;
|
|
2266
2271
|
disabled?: boolean | undefined;
|
|
2267
2272
|
form?: string | undefined;
|
|
@@ -2289,7 +2294,6 @@ declare namespace React {
|
|
|
2289
2294
|
imageSrcSet?: string | undefined;
|
|
2290
2295
|
imageSizes?: string | undefined;
|
|
2291
2296
|
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
|
|
2292
|
-
rel?: string | undefined;
|
|
2293
2297
|
sizes?: string | undefined;
|
|
2294
2298
|
type?: string | undefined;
|
|
2295
2299
|
charSet?: string | undefined;
|
|
@@ -2318,7 +2322,6 @@ declare namespace React {
|
|
|
2318
2322
|
|
|
2319
2323
|
interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
2320
2324
|
charSet?: string | undefined;
|
|
2321
|
-
content?: string | undefined;
|
|
2322
2325
|
httpEquiv?: string | undefined;
|
|
2323
2326
|
name?: string | undefined;
|
|
2324
2327
|
media?: string | undefined;
|
|
@@ -2403,7 +2406,6 @@ declare namespace React {
|
|
|
2403
2406
|
|
|
2404
2407
|
interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
2405
2408
|
autoComplete?: string | undefined;
|
|
2406
|
-
autoFocus?: boolean | undefined;
|
|
2407
2409
|
disabled?: boolean | undefined;
|
|
2408
2410
|
form?: string | undefined;
|
|
2409
2411
|
multiple?: boolean | undefined;
|
|
@@ -2444,7 +2446,6 @@ declare namespace React {
|
|
|
2444
2446
|
|
|
2445
2447
|
interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
2446
2448
|
autoComplete?: string | undefined;
|
|
2447
|
-
autoFocus?: boolean | undefined;
|
|
2448
2449
|
cols?: number | undefined;
|
|
2449
2450
|
dirName?: string | undefined;
|
|
2450
2451
|
disabled?: boolean | undefined;
|
|
@@ -2784,7 +2785,6 @@ declare namespace React {
|
|
|
2784
2785
|
interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
2785
2786
|
allowFullScreen?: boolean | undefined;
|
|
2786
2787
|
allowpopups?: boolean | undefined;
|
|
2787
|
-
autoFocus?: boolean | undefined;
|
|
2788
2788
|
autosize?: boolean | undefined;
|
|
2789
2789
|
blinkfeatures?: string | undefined;
|
|
2790
2790
|
disableblinkfeatures?: string | undefined;
|