Closed hazzard993 closed 5 years ago
There are two ways to call LÖVE's functions. This PR makes these two methods possible.
love.graphics.newImage("image.png");
import { newImage } from "love.graphics"; newImage("image.png");
These modules contain all of LÖVE's functions, types and enums.
Advantages:
Also good for users who prefer to avoid global variables.
Here are the type paths to use for choosing one of these two methods:
love-typescript-definitions
love
/expose-modules-only
love.graphics
/expose-love-global-callbacks
VS Code can automatically create import paths to members within these declarations.
If you want to use LÖVE in this modular way, configure your types in your tsconfig.json like so:
{ "types": [ "love-typescript-definitions/expose-modules-only", "love-typescript-definitions/expose-love-global-callbacks" ] }
love.data.PackedData
import("love.data").PackedData
import { PackedData } from "love.data"
There are two ways to call LÖVE's functions. This PR makes these two methods possible.
These modules contain all of LÖVE's functions, types and enums.
Advantages:
Also good for users who prefer to avoid global variables.
Here are the type paths to use for choosing one of these two methods:
love-typescript-definitions
love
namespace will be globally available./expose-modules-only
love.graphics
, etc)/expose-love-global-callbacks
love
namespace purely for overriding callbacks.If you want to use LÖVE in this modular way, configure your types in your tsconfig.json like so:
love.data.PackedData
must be accessed in a different way. Use...import("love.data").PackedData
orimport { PackedData } from "love.data"