Skip to content

Optionally resolved external types #7056

Closed
@saschanaz

Description

@saschanaz
let stream: MSStream;
const inputStream = stream.msDetachStream(); // any in lib.d.ts

// const inputStream = stream.msDetachStream() as Windows.Storage.Streams.IInputStream; from winrt.d.ts

Can we have a potential-any type information that resolves only when we have correct d.ts file? Some small type definitions in DefinitelyTyped refers much bigger ones e.g. node.d.ts that is not always required. (Imagine a library that supports standard types and Node.js types together.) I hope I can just include a small file without node.d.ts or any other unneeded large files.

Maybe somewhat related to old #1402.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions