mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +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' {
|
||||
const i18n: {
|
||||
defaultLocale: string;
|
||||
locales: [string, ...string[]];
|
||||
currentLocale: string;
|
||||
localeConfigs: {
|
||||
[localeName: string]: {
|
||||
label: string;
|
||||
direction: string;
|
||||
htmlLang: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
import type {I18n} from '@docusaurus/types';
|
||||
|
||||
const i18n: I18n;
|
||||
export = i18n;
|
||||
}
|
||||
|
||||
|
|
|
@ -647,13 +647,11 @@ declare module '@docusaurus/plugin-content-docs/client' {
|
|||
sidebars?: {[sidebarId: string]: GlobalSidebar};
|
||||
};
|
||||
|
||||
export type GlobalSidebarLink = {
|
||||
label: string;
|
||||
path: string;
|
||||
};
|
||||
|
||||
export type GlobalSidebar = {
|
||||
link?: GlobalSidebarLink;
|
||||
link?: {
|
||||
label: string;
|
||||
path: string;
|
||||
};
|
||||
// ... we may add other things here later
|
||||
};
|
||||
export type GlobalPluginData = {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"test": "tsc -p ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/react-loadable": "5.5.2",
|
||||
"react-loadable": "npm:@docusaurus/react-loadable@5.5.2",
|
||||
"commander": "^5.1.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 {ParsedUrlQueryInput} from 'querystring';
|
||||
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 Loadable from 'react-loadable';
|
||||
|
||||
|
@ -130,12 +130,7 @@ export type I18nConfig = {
|
|||
localeConfigs: {[locale: string]: Partial<I18nLocaleConfig>};
|
||||
};
|
||||
|
||||
export type I18n = {
|
||||
defaultLocale: string;
|
||||
locales: [string, ...string[]];
|
||||
currentLocale: string;
|
||||
localeConfigs: {[locale: string]: I18nLocaleConfig};
|
||||
};
|
||||
export type I18n = DeepRequired<I18nConfig> & {currentLocale: string};
|
||||
|
||||
export type GlobalData = {[pluginName: string]: {[pluginId: string]: unknown}};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue