Skip to content

kihira/roll20-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

roll20-ts

Typescript definitions for the Roll20 API

Using the state variable

The state variable has been set up in such a way that you can extend it's definition to help provide you with type completion. This is thanks to the fact that TypeScript merges duplicate interface definitions as long as they are in the same namespace.

As such, all you need to do is add the following to your script

interface State {
    ScriptName: YourObjectDefinition
}

The object definition could be inline or it's own interface. You can see an example of an inline definition below

Inline
interface State {
    ScriptName: {
        property1: number,
        property2: string
    }
}

Examples

Examples of using these typings can be found in the following repos:

About

Typescript definitions for the Roll20 API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published