refactor(v2): migrate core to Typescript ❄️🌀🐋 (#1494)

* refactor(v2): add typing for docusaurus/core

* wip: last working

* refactor(v2): add typing for @docusaurus/core

* prettier

* dont run in parallel otherwise some are uncompiled

* nits

* more typing

* more typing

* nits

* type commands

* nits
This commit is contained in:
Endi 2019-05-20 23:59:04 +07:00 committed by Yangshun Tay
parent 0568ad4992
commit 305e698e6e
74 changed files with 739 additions and 488 deletions

View file

@ -102,7 +102,7 @@ export function genChunkName(
prefix?: string,
preferredName?: string,
): string {
let chunkName = chunkNameCache.get(modulePath);
let chunkName: string | undefined = chunkNameCache.get(modulePath);
if (!chunkName) {
let str = modulePath;
if (preferredName) {
@ -146,10 +146,10 @@ export function parse(
fileString: string,
): {
frontMatter: {
[key: string]: any,
},
content: string,
excerpt: string | undefined,
[key: string]: any;
};
content: string;
excerpt: string | undefined;
} {
const options: {} = {
excerpt: (file: matter.GrayMatterFile<string>): void => {