Skip to content

Using Type Definitions via TS or JSDoc #73

@RayyanNafees

Description

@RayyanNafees

How to use type definitions in kaplay playground, in case i need to do smth like this

I want autocompleted types when I press player. ..

/**
 * Adds movement to GameObjects
 * @param {GameObj<AnchorComp>} player
 */
function movement(player) {
    player
}

This works for basic types like string etc, but doesn't work for smth like GameObj, Any way I can do so ?

For now the only method is by this:

function movement(player=add([anchor()])) {
    player
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions