Skip to content

Instantly share code, notes, and snippets.

@filiptibell
Last active November 11, 2022 19:45
Show Gist options
  • Save filiptibell/50cf97cc93867a2fa62e9ebd2a9ef1a2 to your computer and use it in GitHub Desktop.
Save filiptibell/50cf97cc93867a2fa62e9ebd2a9ef1a2 to your computer and use it in GitHub Desktop.
Type declarations for Remodel, to be used with Luau LSP
-- Type definitions for remodel 0.11.0
declare class RemodelInstance
Name: string
ClassName: string
Parent: RemodelInstance
function Clone(self): RemodelInstance
function Destroy(self): ()
function GetChildren(self): {RemodelInstance}
function GetDescendants(self): {RemodelInstance}
function FindFirstChild(self, name: string): RemodelInstance
end
declare class RemodelWorkspace extends RemodelInstance
Terrain: RemodelInstance
end
declare class RemodelDataModel extends RemodelInstance
Workspace: RemodelWorkspace
function GetService(self, service: string): RemodelInstance
end
declare remodel: {
readPlaceFile: (path: string) -> RemodelDataModel,
readModelFile: (path: string) -> {RemodelInstance},
readPlaceAsset: (assetId: string | number) -> RemodelDataModel,
readModelAsset: (assetId: string | number) -> {RemodelInstance},
writePlaceFile: (path: string, instance: RemodelDataModel) -> (),
writeModelFile: (path: string, instance: Instance) -> (),
writeExistingPlaceAsset: (instance: RemodelInstance, assetId: string | number) -> (),
writeExistingModelAsset: (instance: RemodelInstance, assetId: string | number) -> (),
getRawProperty: (instance: RemodelInstance, name: string) -> any?,
setRawProperty: (instance: RemodelInstance, name: string, type: string, value: any) -> (),
readFile: (path: string) -> string,
readDir: (path: string) -> {string},
writeFile: (path: string, contents: string) -> (),
createDirAll: (path: string) -> (),
removeFile: (path: string) -> (),
removeDir: (path: string) -> (),
isFile: (path: string) -> boolean,
isDir: (path: string) -> boolean,
}
declare json: {
fromString: (source: string) -> any,
toString: (value: any) -> string,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment