Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions typings/grandMA3.Appearances/functions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ type Appearances = Obj<ShowData, Appearance> & Appearance[] & { [index: string]:
type Appearance = Obj<Appearances, null> &
null[] & { [index: string]: null } & {
Image: Image;
ImageR: number;
ImageG: number;
ImageB: number;
ImageAlpha: number;
BackR: number;
BackG: number;
BackB: number;
BackAlpha: number;
};
1 change: 1 addition & 0 deletions typings/grandMA3.DataPool/functions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ type DataPool = Obj<DataPools, any> &
Sequences: Sequences;
Layouts: Layouts;
Plugins: Plugins;
Pages: Pages;
};
5 changes: 5 additions & 0 deletions typings/grandMA3.DataPool/types/Pages.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type Pages = Obj<DataPool, Page> & (Page | null)[] & { [index: string]: Page | null };

type Page = Obj<Pages, Executor> & (Executor | null)[] & { [index: string]: Executor | null };

type Executor = Obj<Page, null> & null[] & { [index: string]: null };
2 changes: 1 addition & 1 deletion typings/grandMA3.DataPool/types/Sequences.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type Sequences = Obj<DataPool, Sequence> &
type Sequence = Obj<Sequences, Cue> &
(Cue | null)[] & { [index: string]: Cue | null } & {
CurrentChild: () => LuaMultiReturn<[Cue | undefined, string]>;
Name: string;
appearance: Appearance | null;
};

type Cue = Obj<Sequence, Part> &
Expand Down
1 change: 1 addition & 0 deletions typings/grandMA3.DataPool/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './Sequences';
import './Layouts';
import './Plugins';
import './Pages';
28 changes: 28 additions & 0 deletions typings/grandMA3.Remotes/functions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
type RemoteTypes = DCRemote | MIDIRemote | DMXRemote;

type Remotes = Obj<ShowData, RemoteType<RemoteTypes>> &
RemoteType<RemoteTypes>[] & { [index: string]: RemoteType<RemoteTypes> } & {
DCRemotes: RemoteType<DCRemote>;
MIDIRemotes: RemoteType<MIDIRemote>;
DMXRemotes: RemoteType<DMXRemote>;
};

type RemoteType<T> = Obj<Remotes, T> &
T[] & { [index: string]: T } & {
enabled: boolean;
feedbackinput: boolean;
};

type DCRemote = Obj<RemoteType<DCRemote>, null> & null[] & { [index: string]: null } & {};

type MIDIRemote = Obj<RemoteType<MIDIRemote>, null> &
null[] & { [index: string]: null } & {
target: Sequence;
fader: string;
key: string;
midichannel: number;
midiindex: number;
miditype: number;
};

type DMXRemote = Obj<RemoteType<DMXRemote>, null> & null[] & { [index: string]: null } & {};
2 changes: 2 additions & 0 deletions typings/grandMA3.Remotes/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './types';
import './functions';
1 change: 1 addition & 0 deletions typings/grandMA3.UserProfile/functions.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
type UserProfile = Obj<UserProfiles, any> &
any[] & { [index: string]: any } & {
LayoutElementDefaultsCollect: LayoutElementDefaultsCollect;
SelectedPage: number;
Name: string;
};
7 changes: 6 additions & 1 deletion typings/grandMA3.lua/functions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ declare function GetVar(...args: any): any;
declare function GlobalVars(...args: any): any;
declare function HandleToInt(...args: any): any;
declare function HandleToStr(...args: any): any;
declare function HookObjectChange(...args: any): any;
declare function HookObjectChange<T>(
callback: (obj: T) => void,
obj: T,
plugin: Plugin,
target?: Obj<any, any>,
): void;
declare function HostOS(...args: any): any;
declare function HostSubType(...args: any): any;
declare function HostType(...args: any): any;
Expand Down
13 changes: 11 additions & 2 deletions typings/grandMA3/functions.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
interface Obj<ParentType, ChildType> {
type ObjDef<ChildType> = {
count: number;
ignorenetwork: boolean | 'UNKNOWN_VALUE';
index: number;
memoryfootprint: number;
name: string;
no: number;
structurelocked: boolean;
} & ChildType[] & { [index: string]: ChildType };

interface Obj<ParentType, ChildType> {
AddListChildren(...args: any): any;
AddListChildrenNames(...args: any): any;
AddListLuaItem(...args: any): any;
Expand Down Expand Up @@ -75,7 +84,7 @@ interface Obj<ParentType, ChildType> {
GridSetColumnSize(...args: any): any;
GridsGetExpandHeaderCell(...args: any): any;
GridsGetLevelButtonWidth(...args: any): any;
HasActivePlayback(...args: any): any;
HasActivePlayback(): boolean;
HasParent(...args: any): any;
HookDelete(...args: any): any;
Import(...args: any): any;
Expand Down
1 change: 1 addition & 0 deletions typings/grandMA3/types/ShowData.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ type ShowData = Obj<Root, any> &
ImagePools: ImagePools;
UserProfiles: UserProfiles;
Appearances: Appearances;
Remotes: Remotes;
};
3 changes: 2 additions & 1 deletion typings/grandMA3/types/UserProfiles.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
type UserProfiles = Obj<ShowData, UserProfile> & UserProfile[] & { [index: string]: UserProfile };
type UserProfiles = Obj<ShowData, UserProfile> &
(UserProfile | null)[] & { [index: string]: UserProfile | null };
2 changes: 2 additions & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import './grandMA3';
import './grandMA3.DataPool';
import './grandMA3.Patch';
import './grandMA3.Remotes';
import './grandMA3.UserProfile';
import './grandMA3.Appearances';
import './grandMA3.lua';
import './lua.ftp';
import './lua.gma3_helpers';
2 changes: 2 additions & 0 deletions typings/lua.ftp/functions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* // to load the FTP module and any libraries it requires run:
* import ftp = require('ftp')
* ```
*
* @noResolution
*/
declare module 'ftp' {
/**
Expand Down
128 changes: 128 additions & 0 deletions typings/lua.gma3_helpers/functions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// Based on http://w3.impa.br/~diego/software/luasocket/ftp.html

/// <reference lib="es2015.iterable" />

/** @noSelfInFile */

/**
* a module that contains general helping functions for gma3
* @example```
* // to load the gma3_helpers module run:
* import 'gma3_helpers'
* ```
*
* @noResolution
*/
declare module 'gma3_helpers' {}

/**
* a module that contains general helping functions for gma3
* @example```
* // to load the gma3_helpers module run:
* import 'gma3_helpers'
* ```
*/
declare const gma3_helpers: {
/**
* Returns content of given variable as string (works with every type, incl. gma3-objects)
*/
dump: (o: any) => string;

/**
* Returns content of gma3-object as string
*/
dumpObj: (o: any) => string;

/**
* Creates fixed width headline
*/
headline: (headlineString: string, myFill: string, size: number) => string;

/**
* Convert \n and \t for Printf()
*/
printfWithNewline: (str: string) => string;

/**
* Create tree-like output of gma3-object
*/
tree: (o: any, maxDepth: number) => void;

/**
* Convert a table like this:
* ```lua
* {
* [1] = {name="testHTP", result=3, min=0, max=100},
* [2] = {name="testLTP", result=5, min=15, max=100}
* }
* ```
* to this:
* ```markdown
* |-----------|-----------|-----------|-----------|-----------|
* | | name | result | min | max |
* |-----------|-----------|-----------|-----------|-----------|
* | 1 | testHTP | 3 | 0 | 100 |
* |-----------|-----------|-----------|-----------|-----------|
* | 2 | testLTP | 5 | 15 | 100 |
* |-----------|-----------|-----------|-----------|-----------|
* ```
* @returns generated string for printing
* @param t is any multidimensional table
* @param forcedColumns is a list of column keys (sorted)
* @param noPrint if Printf to cmdline should be blocked
*/
printTableEntries: (t: any[], forcedColumns: string[], noPrint: boolean) => string;

/**
* Convert a table like this:
* ```lua
* {
* [1] = { [1] = "something", [2] = "else"},
* [2] = { [1] = "test", [2] = "abc"}
* }
* ```
* to this:
* ```markdown
* |-----------|-----------|
* | something | else |
* |-----------|-----------|
* | test | abc |
* |-----------|-----------|
* ```
* @returns generated string for printing
* @param t is any multidimensional table
* @param noPrint if Printf to cmdline should be blocked
*/
printTable2D: (t: any[], noPrint: boolean) => string;

/**
* helper function for os.execute that prints it's result
* @param cmd is the instruction you want to run on the host system
*/
osExecute: (cmd: string) => void;

/**
* helper function for io.popen
* @param path
*/
ioPopen: (path: string) => string;

getObjectExportPath: (object: Obj<any, any>) => string;

getDirectoryContent: (
path: string,
) => { type: 'directory' | 'file'; fullPath: string; name: string }[];

copyFile: (src: string, dst: string) => void;

deleteFolderContent: (desc: {
path: string;
confirm: boolean;
recursive: boolean;
filterFn(name: string): boolean;
}) => void;

repeatUntilTrue: (desc: { func(): boolean; tolerance?: number; interval?: number }) => boolean;

editLuaTable: (t: any[]) => boolean;
};
1 change: 1 addition & 0 deletions typings/lua.gma3_helpers/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './functions';