Skip to content

More TypeScript. Missing types or wrong usage? #3367

@LeJared

Description

@LeJared

Description:

I've some more questions on typescript. Either there are some missing types/signatures or I may be using it wrong:

Ractive.transitions seems to be missing entirely in the types

Ractive.WELCOME_MESSAGE seems to be missing in types or is there another way to silence the welcome message`?

Types for EventPlugin state, that the fire callback takes one argument of type Event but Examples at https://ractive.js.org/plugins/#writing_4 it's used like this: fire({ node: node, original: event }) which does not match the signature. Is the matching signature missing in the types or is it supposed to be used in another way?

I've used Ractive.defaults to add some global helpers to all ractive instances, e.g. to use them in the templates like @.helper()
This used to work back in good old JS days:

Ractive.defaults.helper = function () {
   // do stuff
};

But typescript says that Ractive.defaults does not accept custom properties. Is this missing in the TS types or are there new ways to add methods to all instances, primarily to use them in the templates.

Versions affected:

1.3.14

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