Skip to content

String literal types for app.getPath #140

@Gaelan

Description

@Gaelan

Currently, the signature for app.getPath is as follows:

getPath(name: string): string;

Because there are a limited number of values for name, it would be nice if it could instead be specified with string literals:

getPath(
  name:
    | "home"
    | "appData"
    | "userData"
    | "temp"
    | "exe"
    | "module"
    | "desktop"
    | "documents"
    | "downloads"
    | "music"
    | "pictures"
    | "videos"
    | "logs"
    | "pepperFlashSystemPlugin"
): string;

Among other things, this is really helpful for IDE autocomplete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions