Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

handbook: incorrect recipe for "function with parameters" #4751

Copy link
Copy link
@wardbell

Description

@wardbell
Issue body actions

As I write, the handbook says that the following usage:

zooKeeper.workSchedule = "morning";
zooKeeper(giraffeCage);

should have the following TypeScript declaration

// Note: Function must precede module
function zooKeeper(cage: AnimalCage);
module zooKeeper {
    var workSchedule: string;
}

That doesn't work AFAIK. I believe the recommendation should be:

interface zooKeeper {
  (cage:AnimalCage) : void;
  workSchedule: string;
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadDeprecated - use "Working as Intended" or "Design Limitation" insteadDocsThe issue relates to how you learn TypeScriptThe issue relates to how you learn TypeScript

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.