Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JoergAtGithub committed Jun 8, 2022
1 parent 92e35a0 commit dcb2cf5
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 33 deletions.
50 changes: 27 additions & 23 deletions res/controllers/console-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,84 +7,88 @@ declare class QJSEngineConsoleExtension {
/**
* Prints debugging information to the console. (same as console.debug)
*/
public log(message? : any, ...args : any[]) : void;
public log(message?:any, ...args:any[]):void;

/**
* Prints debugging information to the console. (same as console.log)
*/
public debug(message? : any, ...args : any[]) : void;
public debug(message?:any, ...args:any[]):void;

/**
* Prints information to the console.
*/
public info(message? : any, ...args : any[]) : void;
public info(message?:any, ...args:any[]):void;

/**
* Prints a warning message to the console.
*/
public warn(message? : any, ...args : any[]) : void;
public warn(message?:any, ...args:any[]):void;

/**
* Prints an error message to the console.
*/
public error(message? : any, ...args : any[]) : void;
public error(message?:any, ...args:any[]):void;

/**
* Tests that an expression is true.
*
* @param {boolean} [expression] If not true, it writes an optional message to the console and prints the stack trace.
* @param expression If not true, it writes an optional message to the console and prints the stack trace.
* @param message
* @param args
*/
public assert(expression : boolean, message? : string, ...args: any[]) : void;
public assert(expression:boolean, message?:string, ...args: any[]):void;

/**
* Starts the time measurement, which will be printed by timeEnd
*
* @param {string} [label] string argument that identifies the measurement.
*
* @param label string argument that identifies the measurement.
*/
public time(label? : string) : void;
public time(label?:string):void;
/**
* Logs the time (in milliseconds) that was spent since the call of the time method.
*
* @param {string} [label] string argument that identifies the measurement.
*
* @param label string argument that identifies the measurement.
*/
public timeEnd(label? : string) : void;
public timeEnd(label?:string):void;

/**
* Prints the stack trace of the JavaScript execution at the point where it was called.
* This stack trace information contains the function name, file name, line number, and column number.
* The stack trace is limited to last 10 stack frames.
*
* @param {*} [message]
* @param {...any[]} args
*
* @param message
* @param args
*/
public trace(message? : any, ...args : any[]) : void;
public trace(message?:any, ...args:any[]):void;

/**
* Prints the current number of times a particular piece of code has run, along with a message.
*
* @param {string} [label]
* @param label
*/
public count(label? : string) : void;
public count(label?:string):void;

/**
* Turns on the JavaScript profiler.
* @deprecated Not usable for controller mappings, because JavaScript profile does only workin GUI thread: https://bugreports.qt.io/browse/QTBUG-65419
*
*/
public profile(label? : string) : void;
public profile(label?:string):void;

/**
* Turns off the JavaScript profiler.
* @deprecated Not usable for controller mappings, because JavaScript profile does only workin GUI thread: https://bugreports.qt.io/browse/QTBUG-65419
*
*/
public profileEnd(label? : string) : void;
public profileEnd(label?:string):void;

/**
* Prints an error message together with the stack trace of JavaScript execution at the point where it is called.
*
*
* @param message
* @param args
*/
public exception(message? : any, ...args : any[]) : void;
public exception(message?:any, ...args:any[]):void;

}
var console = new QJSEngineConsoleExtension;
13 changes: 7 additions & 6 deletions res/controllers/hid-controller-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ declare class HidControllerJSProxy {
* @param dataList Data to send as list of bytes
* @param length Unused optional argument
*/
public send(dataList : number[], length : number=0) : void;
public send(dataList:number[], length:number=0):void;

/** Sends HID OutputReport to HID device
* @param dataList Data to send as list of bytes
* @param length Unused but mandatory argument
* @param reportID 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use ReportIDs
* @param resendUnchangedReport If set, the report will also be send, if the data are unchanged since last sending
*/
public send(dataList : number[], length : number, reportID : number, resendUnchangedReport:boolean = false) : void;
public send(dataList:number[], length:number, reportID:number, resendUnchangedReport:boolean = false):void;

/** Sends an OutputReport to HID device
* @param reportID 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use ReportIDs
* @param dataArray Data to send as byte array (Javascript type Uint8Array)
* @param resendUnchangedReport If set, the report will also be send, if the data are unchanged since last sending
*/
public sendOutputReport(reportID : number, dataArray : ArrayBuffer, resendUnchangedReport:boolean = false) : void;
public sendOutputReport(reportID:number, dataArray:ArrayBuffer, resendUnchangedReport:boolean = false):void;

/** getInputReport receives an InputReport from the HID device on request.
* @details This can be used on startup to initialize the knob positions in Mixxx
Expand All @@ -28,19 +29,19 @@ declare class HidControllerJSProxy {
* @param reportID 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use
* @return Returns report data with ReportID byte as prefix
*/
public getInputReport(reportID : number) : Uint8Array;
public getInputReport(reportID:number):Uint8Array;

/** Sends a FeatureReport to HID device
* @param reportID 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use
* @param reportData Data to send as byte array
*/
public sendFeatureReport(reportID : number, reportData : ArrayBuffer) : void;
public sendFeatureReport(reportID:number, reportData:ArrayBuffer):void;

/** getFeatureReport receives a FeatureReport from the HID device on request.
* @param reportID 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use
* @return The returned array matches the input format of sendFeatureReport,
* allowing it to be read, modified and sent it back to the controller.
*/
public getFeatureReport(reportID : number) : Uint8Array;
public getFeatureReport(reportID:number):Uint8Array;
}
var controller = new HidControllerJSProxy;
17 changes: 13 additions & 4 deletions res/controllers/midi-controller-api.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@

declare class MidiControllerJSProxy {

public sendShortMsg(status : number, byte1 : number, byte2 : number) : void;
public :ShortMsg(status:number, byte1:number, byte2:number):void;

/** Alias for sendSysexMsg */
public send(dataList : number[], length : number=0) : void;
public sendSysexMsg(dataList : number[], length : number=0) : void;
/**
* Alias for :SysexMsg
* @param dataList
* @param length
*/
public :(dataList:number[], length:number=0):void;
/**
*
* @param dataList
* @param length
*/
public :SysexMsg(dataList:number[], length:number=0):void;

}
var controller = new MidiControllerJSProxy;

0 comments on commit dcb2cf5

Please sign in to comment.