mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +02:00
refactor: minor type improvements (#7035)
This commit is contained in:
parent
755b03861c
commit
c81d21a641
4 changed files with 10 additions and 25 deletions
|
@ -56,18 +56,9 @@ declare module '@generated/globalData' {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@generated/i18n' {
|
declare module '@generated/i18n' {
|
||||||
const i18n: {
|
import type {I18n} from '@docusaurus/types';
|
||||||
defaultLocale: string;
|
|
||||||
locales: [string, ...string[]];
|
const i18n: I18n;
|
||||||
currentLocale: string;
|
|
||||||
localeConfigs: {
|
|
||||||
[localeName: string]: {
|
|
||||||
label: string;
|
|
||||||
direction: string;
|
|
||||||
htmlLang: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export = i18n;
|
export = i18n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -647,13 +647,11 @@ declare module '@docusaurus/plugin-content-docs/client' {
|
||||||
sidebars?: {[sidebarId: string]: GlobalSidebar};
|
sidebars?: {[sidebarId: string]: GlobalSidebar};
|
||||||
};
|
};
|
||||||
|
|
||||||
export type GlobalSidebarLink = {
|
export type GlobalSidebar = {
|
||||||
|
link?: {
|
||||||
label: string;
|
label: string;
|
||||||
path: string;
|
path: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type GlobalSidebar = {
|
|
||||||
link?: GlobalSidebarLink;
|
|
||||||
// ... we may add other things here later
|
// ... we may add other things here later
|
||||||
};
|
};
|
||||||
export type GlobalPluginData = {
|
export type GlobalPluginData = {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
"test": "tsc -p ."
|
"test": "tsc -p ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@docusaurus/react-loadable": "5.5.2",
|
||||||
"react-loadable": "npm:@docusaurus/react-loadable@5.5.2",
|
"react-loadable": "npm:@docusaurus/react-loadable@5.5.2",
|
||||||
"commander": "^5.1.0",
|
"commander": "^5.1.0",
|
||||||
"history": "^4.9.0",
|
"history": "^4.9.0",
|
||||||
|
|
9
packages/docusaurus-types/src/index.d.ts
vendored
9
packages/docusaurus-types/src/index.d.ts
vendored
|
@ -10,7 +10,7 @@ import type {CustomizeRuleString} from 'webpack-merge/dist/types';
|
||||||
import type {CommanderStatic} from 'commander';
|
import type {CommanderStatic} from 'commander';
|
||||||
import type {ParsedUrlQueryInput} from 'querystring';
|
import type {ParsedUrlQueryInput} from 'querystring';
|
||||||
import type Joi from 'joi';
|
import type Joi from 'joi';
|
||||||
import type {Overwrite, DeepPartial} from 'utility-types';
|
import type {Overwrite, DeepPartial, DeepRequired} from 'utility-types';
|
||||||
import type {Location} from 'history';
|
import type {Location} from 'history';
|
||||||
import type Loadable from 'react-loadable';
|
import type Loadable from 'react-loadable';
|
||||||
|
|
||||||
|
@ -130,12 +130,7 @@ export type I18nConfig = {
|
||||||
localeConfigs: {[locale: string]: Partial<I18nLocaleConfig>};
|
localeConfigs: {[locale: string]: Partial<I18nLocaleConfig>};
|
||||||
};
|
};
|
||||||
|
|
||||||
export type I18n = {
|
export type I18n = DeepRequired<I18nConfig> & {currentLocale: string};
|
||||||
defaultLocale: string;
|
|
||||||
locales: [string, ...string[]];
|
|
||||||
currentLocale: string;
|
|
||||||
localeConfigs: {[locale: string]: I18nLocaleConfig};
|
|
||||||
};
|
|
||||||
|
|
||||||
export type GlobalData = {[pluginName: string]: {[pluginId: string]: unknown}};
|
export type GlobalData = {[pluginName: string]: {[pluginId: string]: unknown}};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue