Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ repos:
rev: ffb6a759a979008c0e6dff86e39f4745a2d9eac4 # frozen: 3.1.0
hooks:
- id: prettier
types: [yaml]
files: \.(d\.ts|ya?ml)$
- repo: https://github.com/qarmin/qml_formatter.git
rev: 37c2513b1b8275a475a160ed2f5b044910335d5f # No release tag yet including #6 fix
hooks:
Expand Down
11 changes: 11 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
tabWidth: 2
singleQuote: false

overrides:
- files: "*.d.ts"
options:
printWidth: 180
tabWidth: 4
semi: true
singleQuote: true
trailingComma: all
bracketSpacing: true
useTabs: false
5 changes: 2 additions & 3 deletions res/controllers/color-mapper-api.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/** ColorMapperJSProxy */

declare class ColorMapper {
Expand All @@ -7,7 +6,7 @@ declare class ColorMapper {
*
* @param availableColors List of number pairs (e.g. {0xFF0000: 1, 0x00FF00: 2} )
*/
constructor (availableColors: { [rgbColor: number]: number });
constructor(availableColors: { [rgbColor: number]: number });

/**
* For a given RGB color code (e.g. 0xFF0000), this finds the nearest
Expand All @@ -16,7 +15,7 @@ declare class ColorMapper {
*
* @param colorCode Device specific color code
*/
getNearestColor(colorCode: number): {[rgb: number]: number};
getNearestColor(colorCode: number): { [rgb: number]: number };

/**
* For a given RGB color code (e.g. 0xFF0000), this finds the nearest
Expand Down
4 changes: 1 addition & 3 deletions res/controllers/console-api.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
Mixxx installs the QJSEngine::ConsoleExtension for the use in controller mapping scripts.
See also:
Expand Down Expand Up @@ -118,7 +117,7 @@ declare namespace console {
* @param label measurement label
* @deprecated Not usable for controller mappings for now [see QTBUG-65419]{@link https://bugreports.qt.io/browse/QTBUG-65419}
*/
function profile(label?: string): void;
function profile(label?: string): void;

/**
* Turns off the JavaScript profiler.
Expand All @@ -136,5 +135,4 @@ declare namespace console {
* - Or a string containing zero or more substitution strings followed by a list of objects to replace them
*/
function exception(...data: any[]): void;

}
8 changes: 3 additions & 5 deletions res/controllers/engine-api.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/** ScriptConnectionJSProxy */

declare interface ScriptConnection {
Expand Down Expand Up @@ -31,7 +30,6 @@ declare interface ScriptConnection {
readonly isConnected: boolean;
}


/** ControllerScriptInterfaceLegacy */

declare namespace engine {
Expand Down Expand Up @@ -122,7 +120,7 @@ declare namespace engine {
*/
function getDefaultParameter(group: string, name: string): number;

type CoCallback = (value: number, group: string, name: string) => void
type CoCallback = (value: number, group: string, name: string) => void;

/**
* Connects a specified Mixxx Control with a callback function, which is executed if the value of the control changes
Expand Down Expand Up @@ -163,7 +161,6 @@ declare namespace engine {
*/
function connectControl(group: string, name: string, callback: CoCallback, disconnect?: boolean): ScriptConnection | boolean | undefined;


/**
* Triggers the execution of all connected callback functions, with the actual value of a control.
* Note: To trigger a single connection, use {@link ScriptConnection.trigger} instead
Expand Down Expand Up @@ -332,6 +329,7 @@ declare namespace engine {
*/
function isSoftStartActive(deck: number): bool;

// prettier-ignore
enum Charset {
ASCII, // American Standard Code for Information Interchange (7-Bit)
UTF_8, // Unicode Transformation Format (8-Bit)
Expand Down Expand Up @@ -368,5 +366,5 @@ declare namespace engine {
* @param targetCharset The charset to encode the string into.
* @returns The converted String as an array of bytes. Will return an empty buffer on conversion error or unavailable charset.
*/
function convertCharset(targetCharset: Charset, value: string): ArrayBuffer
function convertCharset(targetCharset: Charset, value: string): ArrayBuffer;
}
1 change: 0 additions & 1 deletion res/controllers/hid-controller-api.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/** HidControllerJSProxy */

declare namespace controller {
Expand Down
7 changes: 3 additions & 4 deletions res/controllers/midi-controller-api.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type MidiInputHandler = (channel: number, control: number, value:number, status:number, group:string) => void;
type MidiInputHandler = (channel: number, control: number, value: number, status: number, group: string) => void;

declare interface MidiInputHandlerController {
disconnect(): boolean;
Expand All @@ -7,7 +7,6 @@ declare interface MidiInputHandlerController {
/** MidiControllerJSProxy */

declare namespace midi {

/**
* Sends a 3 byte MIDI short message
*
Expand All @@ -34,7 +33,7 @@ declare namespace midi {
*/
function sendSysexMsg(dataList: number[], length?: number): void;

type InputCallback = (channel: string, control: string, value: number, status: number) => void
type InputCallback = (channel: string, control: string, value: number, status: number) => void;

/**
* Calls the provided callback whenever Mixxx receives a MIDI signal with the first two bytes matching the
Expand All @@ -45,5 +44,5 @@ declare namespace midi {
* @see https://github.com/mixxxdj/mixxx/wiki/midi%20scripting
* @see https://github.com/mixxxdj/mixxx/wiki/Midi-Crash-Course
*/
function makeInputHandler(status: number, midino: number, callback: InputCallback): MidiInputHandlerController
function makeInputHandler(status: number, midino: number, callback: InputCallback): MidiInputHandlerController;
}