UNPKG

@jxa/types

Version:
168 lines (167 loc) 6.37 kB
import { StandardAdditions } from "./core/StandardAdditions"; import { TextEdit } from "./core/TextEdit"; import { VoiceOver } from "./core/VoiceOver"; import { Terminal } from "./core/Terminal"; import { SystemEvents } from "./core/SystemEvents"; import { SpeechRecognitionServer } from "./core/SpeechRecognitionServer"; import { ScriptEditor } from "./core/ScriptEditor"; import { Calendar } from "./core/Calendar"; import { Contacts } from "./core/Contacts"; import { DatabaseEvents } from "./core/DatabaseEvents"; import { Finder } from "./core/Finder"; import { FontBook } from "./core/FontBook"; import { ImageEvents } from "./core/ImageEvents"; import { Keynote } from "./core/Keynote"; import { Mail } from "./core/Mail"; import { Messages } from "./core/Messages"; import { Notes } from "./core/Notes"; import { Numbers } from "./core/Numbers"; import { Pages } from "./core/Pages"; import { Photos } from "./core/Photos"; import { QuickTimePlayer } from "./core/QuickTimePlayer"; import { Reminders } from "./core/Reminders"; import { Safari } from "./core/Safari"; import { DVDPlayer } from "./core/DVDPlayer"; import { iTunes } from "./core/iTunes"; export = Application; declare type App = typeof Application & Application._StandardAdditions & Application.AnyValue; /** * bundle ID or name or path or remote machine */ declare function Application(name: string): typeof Application & Application._StandardAdditions & Application.AnyValue; /** * Pass custom Application type as generics * Return Application's StandardAdditions & T type */ declare function Application<T>(name: string): typeof Application & Application._StandardAdditions & Application.AnyValue & T; declare function Application(name: "Calendar"): App & Application._Calendar; declare function Application(name: "Contacts"): App & Application._Contacts; declare function Application(name: "Database Events"): App & Application._DatabaseEvents; declare function Application(name: "DVD Player"): App & Application._DVDPlayer; declare function Application(name: "Finder"): App & Application._Finder; declare function Application(name: "Font Book"): App & Application._FontBook; declare function Application(name: "Image Events"): App & Application._ImageEvents; declare function Application(name: "iTunes"): App & Application._iTunes; declare function Application(name: "Keynote"): App & Application._Keynote; declare function Application(name: "Mail"): App & Application._Mail; declare function Application(name: "Messages"): App & Application._Messages; declare function Application(name: "Notes"): App & Application._Notes; declare function Application(name: "Numbers"): App & Application._Numbers; declare function Application(name: "Pages"): App & Application._Pages; declare function Application(name: "Photos"): App & Application._Photos; declare function Application(name: "QuickTime Player"): App & Application._QuickTimePlayer; declare function Application(name: "Reminders"): App & Application._Reminders; declare function Application(name: "Safari"): App & Application._Safari; declare function Application(name: "Script Editor"): App & Application._ScriptEditor; declare function Application(name: "SpeechRecognitionServer"): App & Application._SpeechRecognitionServer; declare function Application(name: "System Events"): App & Application._SystemEvents; declare function Application(name: "Terminal"): App & Application._Terminal; declare function Application(name: "TextEdit"): App & Application._TextEdit; declare function Application(name: "VoiceOver"): App & Application._VoiceOver; /** * process ID */ declare function Application(id: number): typeof Application & Application._StandardAdditions & Application.AnyValue; declare function Application<T>(id: number): typeof Application & Application._StandardAdditions & Application.AnyValue & T; declare namespace Application { interface _StandardAdditions extends StandardAdditions { } interface _Calendar extends Calendar { } interface _Contacts extends Contacts { } interface _DatabaseEvents extends DatabaseEvents { } interface _DVDPlayer extends DVDPlayer { } interface _Finder extends Finder { } interface _FontBook extends FontBook { } interface _ImageEvents extends ImageEvents { } interface _iTunes extends iTunes { } interface _Keynote extends Keynote { } interface _Mail extends Mail { } interface _Messages extends Messages { } interface _Notes extends Notes { } interface _Numbers extends Numbers { } interface _Pages extends Pages { } interface _Photos extends Photos { } interface _QuickTimePlayer extends QuickTimePlayer { } interface _Reminders extends Reminders { } interface _Safari extends Safari { } interface _TextEdit extends TextEdit { } interface _ScriptEditor extends ScriptEditor { } interface _SpeechRecognitionServer extends SpeechRecognitionServer { } interface _SystemEvents extends SystemEvents { } interface _Terminal extends Terminal { } interface _VoiceOver extends VoiceOver { } interface AnyValue { [index: string]: any; [index: number]: any; } /** * Return current app */ function currentApplication<T = any>(): typeof Application & Application._StandardAdditions & Application.AnyValue; /** * It should be true if you use StandardAdditions */ var includeStandardAdditions: boolean; function id(): number; function name(): string; /** * Return true if the app is running * @returns {boolean} */ function running(): boolean; /** * active the app */ function activate(): void; /** * quit the app */ function quit(): void; /** * launch the app */ function launch(): void; /** * get command names */ function commandsOfClass(): string[]; /** * get element names */ function elementsOfClass(className: string): string[]; /** * get property names */ function propertiesOfClass(className: string): string[]; /** * get parent object name * @param {string} className * @returns {string} */ function parentOfClass(className: string): string; var windows: any; }