如何扩展typescript内置类型中的类型

如何扩展typescript内置类型中的类型,typescript,types,Typescript,Types,我想在typescript/lib/lib.dom.d.ts 我尝试使用这个代码 declare module "typescript/lib/lib.dom.d" { interface File { readonly filepath?: string readonly webkitRelativePath?: string } } 但这是失败的 有人知道怎么做吗

我想在
typescript/lib/lib.dom.d.ts

我尝试使用这个代码

declare module "typescript/lib/lib.dom.d"
{
    interface File
    {
        readonly filepath?: string
        readonly webkitRelativePath?: string
    }
}
但这是失败的

有人知道怎么做吗