From 13fafd44eb88490e6516ef8f116a17661142b146 Mon Sep 17 00:00:00 2001 From: David G Rosenberg Date: Mon, 22 Apr 2024 13:11:53 -0400 Subject: [PATCH] Split types into separate files --- src/types/index.ts | 3 +++ src/types/infoPlist.ts | 24 ++++++++++++++++++++++++ src/types/jxa.ts | 5 +++++ src/{types.ts => types/msda.ts} | 31 ------------------------------- 4 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 src/types/index.ts create mode 100644 src/types/infoPlist.ts create mode 100644 src/types/jxa.ts rename src/{types.ts => types/msda.ts} (55%) diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..09cefae --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,3 @@ +export * from './infoPlist'; +export * from './jxa'; +export * from './msda'; diff --git a/src/types/infoPlist.ts b/src/types/infoPlist.ts new file mode 100644 index 0000000..e45f4ed --- /dev/null +++ b/src/types/infoPlist.ts @@ -0,0 +1,24 @@ +export type DocumentType = { + CFBundleTypeExtensions?: string[]; + CFBundleTypeMIMETypes?: string[]; + CFBundleTypeRole: + | 'Editor' + | 'Viewer' + | 'Shell' + | 'QLGenerator' + | 'None' + | 'All'; +}; + +export type UTIType = { + CFBundleURLSchemes: string[]; +}; + +export type InfoPlist = { + CFBundleDisplayName: string; + CFBundleDocumentTypes?: DocumentType[]; + CFBundleIdentifier: string; + CFBundleName: string; + CFBundleShortVersionString: string; + CFBundleURLTypes?: UTIType[]; +}; diff --git a/src/types/jxa.ts b/src/types/jxa.ts new file mode 100644 index 0000000..d5fcfd1 --- /dev/null +++ b/src/types/jxa.ts @@ -0,0 +1,5 @@ +import '@jxa/global-type'; + +export type JXAApplication = typeof Application & + Application._StandardAdditions & + Application.AnyValue; diff --git a/src/types.ts b/src/types/msda.ts similarity index 55% rename from src/types.ts rename to src/types/msda.ts index d99ddf6..915af25 100644 --- a/src/types.ts +++ b/src/types/msda.ts @@ -1,34 +1,3 @@ -import '@jxa/global-type'; - -export type DocumentType = { - CFBundleTypeExtensions?: string[]; - CFBundleTypeMIMETypes?: string[]; - CFBundleTypeRole: - | 'Editor' - | 'Viewer' - | 'Shell' - | 'QLGenerator' - | 'None' - | 'All'; -}; - -export type UTLType = { - CFBundleURLSchemes: string[]; -}; - -export type InfoPlist = { - CFBundleDisplayName: string; - CFBundleDocumentTypes?: DocumentType[]; - CFBundleIdentifier: string; - CFBundleName: string; - CFBundleShortVersionString: string; - CFBundleURLTypes?: UTLType[]; -}; - -export type JXAApplication = typeof Application & - Application._StandardAdditions & - Application.AnyValue; - export type UTIRole = 'Viewer' | 'Shell' | 'QLGenerator' | 'None' | 'All'; export type DefaultApp = {