rork-xcode 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -204,20 +204,26 @@ declare class PbxprojBuildError extends Error {
204
204
  */
205
205
  declare const Isa: {
206
206
  readonly aggregateTarget: "PBXAggregateTarget";
207
+ readonly appleScriptBuildPhase: "PBXAppleScriptBuildPhase";
207
208
  readonly buildFile: "PBXBuildFile";
208
209
  readonly buildRule: "PBXBuildRule";
210
+ readonly buildStyle: "PBXBuildStyle";
209
211
  readonly containerItemProxy: "PBXContainerItemProxy";
210
212
  readonly copyFilesBuildPhase: "PBXCopyFilesBuildPhase";
211
213
  readonly fileReference: "PBXFileReference";
212
214
  readonly fileSystemSynchronizedBuildFileExceptionSet: "PBXFileSystemSynchronizedBuildFileExceptionSet";
215
+ readonly fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet: "PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet";
213
216
  readonly fileSystemSynchronizedRootGroup: "PBXFileSystemSynchronizedRootGroup";
214
217
  readonly frameworksBuildPhase: "PBXFrameworksBuildPhase";
215
218
  readonly group: "PBXGroup";
219
+ readonly headersBuildPhase: "PBXHeadersBuildPhase";
216
220
  readonly legacyTarget: "PBXLegacyTarget";
217
221
  readonly nativeTarget: "PBXNativeTarget";
218
222
  readonly project: "PBXProject";
219
223
  readonly referenceProxy: "PBXReferenceProxy";
220
224
  readonly resourcesBuildPhase: "PBXResourcesBuildPhase";
225
+ readonly rezBuildPhase: "PBXRezBuildPhase";
226
+ readonly shellScriptBuildPhase: "PBXShellScriptBuildPhase";
221
227
  readonly sourcesBuildPhase: "PBXSourcesBuildPhase";
222
228
  readonly targetDependency: "PBXTargetDependency";
223
229
  readonly variantGroup: "PBXVariantGroup";
@@ -307,6 +313,8 @@ interface BuildSettings extends PbxprojObject {
307
313
  SUPPORTED_PLATFORMS?: string;
308
314
  SWIFT_VERSION?: string;
309
315
  TARGETED_DEVICE_FAMILY?: number | string;
316
+ TEST_HOST?: string;
317
+ TEST_TARGET_NAME?: string;
310
318
  TVOS_DEPLOYMENT_TARGET?: string;
311
319
  WATCHOS_DEPLOYMENT_TARGET?: string;
312
320
  XROS_DEPLOYMENT_TARGET?: string;
@@ -403,21 +411,31 @@ interface ReferenceProxyProperties extends PbxprojObject {
403
411
  sourceTree?: string;
404
412
  }
405
413
  /**
406
- * Properties shared by the `PBX*BuildPhase` kinds. Copy-files and
407
- * shell-script phases carry the destination and script keys. The standard
408
- * phases leave them absent.
414
+ * Properties shared by every `PBX*BuildPhase` kind.
409
415
  */
410
416
  interface BuildPhaseProperties extends PbxprojObject {
411
417
  buildActionMask?: number;
418
+ files?: string[];
419
+ name?: string;
420
+ runOnlyForDeploymentPostprocessing?: number;
421
+ }
422
+ /**
423
+ * Properties of a `PBXCopyFilesBuildPhase`, which adds the destination
424
+ * the files are copied to.
425
+ */
426
+ interface CopyFilesBuildPhaseProperties extends BuildPhaseProperties {
412
427
  dstPath?: string;
413
428
  dstSubfolderSpec?: number;
414
- files?: string[];
429
+ }
430
+ /**
431
+ * Properties of a `PBXShellScriptBuildPhase`, which adds the script, its
432
+ * interpreter, and the declared inputs and outputs.
433
+ */
434
+ interface ShellScriptBuildPhaseProperties extends BuildPhaseProperties {
415
435
  inputFileListPaths?: string[];
416
436
  inputPaths?: string[];
417
- name?: string;
418
437
  outputFileListPaths?: string[];
419
438
  outputPaths?: string[];
420
- runOnlyForDeploymentPostprocessing?: number;
421
439
  shellPath?: string;
422
440
  shellScript?: string;
423
441
  }
@@ -485,15 +503,25 @@ interface ContainerItemProxyProperties extends PbxprojObject {
485
503
  remoteInfo?: string;
486
504
  }
487
505
  /**
488
- * Properties of an `XCRemoteSwiftPackageReference` or
489
- * `XCLocalSwiftPackageReference`. Remote references carry the repository
490
- * and requirement. Local ones carry the relative path.
506
+ * Properties shared by the Swift package reference kinds. The remote and
507
+ * local interfaces below add their own keys.
491
508
  */
492
- interface SwiftPackageReferenceProperties extends PbxprojObject {
493
- relativePath?: string;
509
+ interface SwiftPackageReferenceProperties extends PbxprojObject {}
510
+ /**
511
+ * Properties of an `XCRemoteSwiftPackageReference`, which names a
512
+ * repository and a version requirement.
513
+ */
514
+ interface RemoteSwiftPackageReferenceProperties extends SwiftPackageReferenceProperties {
494
515
  repositoryURL?: string;
495
516
  requirement?: PbxprojObject;
496
517
  }
518
+ /**
519
+ * Properties of an `XCLocalSwiftPackageReference`, which names a package
520
+ * directory relative to the project.
521
+ */
522
+ interface LocalSwiftPackageReferenceProperties extends SwiftPackageReferenceProperties {
523
+ relativePath?: string;
524
+ }
497
525
  /**
498
526
  * Properties of an `XCSwiftPackageProductDependency`.
499
527
  */
@@ -502,14 +530,28 @@ interface SwiftPackageProductDependencyProperties extends PbxprojObject {
502
530
  productName?: string;
503
531
  }
504
532
  /**
505
- * Properties of a `PBXFileSystemSynchronizedBuildFileExceptionSet` or its
506
- * build-phase-membership variant.
533
+ * Properties shared by the synchronized-folder exception set kinds.
507
534
  */
508
535
  interface ExceptionSetProperties extends PbxprojObject {
509
- buildPhase?: string;
510
536
  membershipExceptions?: string[];
511
537
  target?: string;
512
538
  }
539
+ /**
540
+ * Properties of a
541
+ * `PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet`, which
542
+ * adds the build phase the listed files belong to.
543
+ */
544
+ interface BuildPhaseMembershipExceptionSetProperties extends ExceptionSetProperties {
545
+ buildPhase?: string;
546
+ }
547
+ /**
548
+ * Properties of a `PBXBuildStyle`, the pre-Xcode-2 predecessor of
549
+ * `XCBuildConfiguration` still found in old documents.
550
+ */
551
+ interface BuildStyleProperties extends PbxprojObject {
552
+ buildSettings?: BuildSettings;
553
+ name?: string;
554
+ }
513
555
  //#endregion
514
556
  //#region src/model/target.d.ts
515
557
  /**
@@ -524,15 +566,20 @@ declare class Target<Properties extends TargetProperties = TargetProperties> ext
524
566
  * The target's name, when present.
525
567
  */
526
568
  get name(): string | undefined;
569
+ /**
570
+ * The view of the target's configuration list, when the reference
571
+ * resolves.
572
+ */
573
+ configurationList(): ConfigurationList | undefined;
527
574
  /**
528
575
  * The views of the target's build configurations, in list order.
529
576
  */
530
- buildConfigurations(): XcodeObject[];
577
+ buildConfigurations(): BuildConfiguration[];
531
578
  /**
532
- * The settings dictionary of the target's default configuration: the one
533
- * named by the list's `defaultConfigurationName`, falling back to the
534
- * first configuration. Returns `undefined` when the target has no
535
- * configurations or the default carries no settings dictionary.
579
+ * The settings dictionary of the target's default configuration, which
580
+ * is the one named by the list's `defaultConfigurationName`, falling
581
+ * back to the first configuration. Returns `undefined` when the target
582
+ * has no configurations or the default carries no settings dictionary.
536
583
  */
537
584
  defaultConfigurationSettings(): PbxprojObject | undefined;
538
585
  /**
@@ -556,11 +603,10 @@ declare class Target<Properties extends TargetProperties = TargetProperties> ext
556
603
  */
557
604
  removeBuildSetting(key: string): void;
558
605
  /**
559
- * The views of the target's dependency objects
560
- * (`PBXTargetDependency`), in declaration order. Resolve a dependency's
561
- * target through its `target` property.
606
+ * The views of the target's dependencies, in declaration order. Resolve
607
+ * a dependency's target through {@link TargetDependency.target}.
562
608
  */
563
- dependencies(): XcodeObject[];
609
+ dependencies(): TargetDependency[];
564
610
  /**
565
611
  * The views of the target's build phases, in build order.
566
612
  */
@@ -587,7 +633,7 @@ declare class Target<Properties extends TargetProperties = TargetProperties> ext
587
633
  * @param name Display name of the phase, which is also its match key.
588
634
  * @param properties Phase properties, most usefully `shellScript`.
589
635
  */
590
- ensureShellScriptPhase(name: string, properties?: PbxprojObject): BuildPhase;
636
+ ensureShellScriptPhase(name: string, properties?: PbxprojObject): ShellScriptBuildPhase;
591
637
  /**
592
638
  * Adds a dependency on another target of the same project, wiring the
593
639
  * `PBXContainerItemProxy` and `PBXTargetDependency` pair Xcode uses to
@@ -595,13 +641,14 @@ declare class Target<Properties extends TargetProperties = TargetProperties> ext
595
641
  *
596
642
  * @returns The view of the target dependency object.
597
643
  */
598
- addDependency(dependency: Target): XcodeObject;
644
+ addDependency(dependency: Target): TargetDependency;
599
645
  }
600
646
  /**
601
647
  * A `PBXNativeTarget` is a product the project compiles and packages
602
648
  * itself, such as an application or an app extension.
603
649
  */
604
650
  declare class NativeTarget extends Target<NativeTargetProperties> {
651
+ static readonly isa: string | null;
605
652
  /**
606
653
  * The target's product type identifier, for example
607
654
  * `com.apple.product-type.application`.
@@ -616,7 +663,7 @@ declare class NativeTarget extends Target<NativeTargetProperties> {
616
663
  * The view of the target's product file reference, when the target has
617
664
  * one.
618
665
  */
619
- get productReference(): XcodeObject | undefined;
666
+ get productReference(): FileReference | undefined;
620
667
  /**
621
668
  * Whether the target builds for watchOS, decided by its product type or
622
669
  * its watchOS deployment-target setting.
@@ -626,7 +673,7 @@ declare class NativeTarget extends Target<NativeTargetProperties> {
626
673
  * The views of the target's Swift package product dependencies, in
627
674
  * declaration order.
628
675
  */
629
- packageProductDependencies(): XcodeObject[];
676
+ packageProductDependencies(): SwiftPackageProductDependency[];
630
677
  /**
631
678
  * The views of the target's file-system-synchronized folders, in
632
679
  * declaration order.
@@ -640,15 +687,15 @@ declare class NativeTarget extends Target<NativeTargetProperties> {
640
687
  /**
641
688
  * The target's sources phase, created when missing.
642
689
  */
643
- ensureSourcesPhase(): BuildPhase;
690
+ ensureSourcesPhase(): SourcesBuildPhase;
644
691
  /**
645
692
  * The target's frameworks phase, created when missing.
646
693
  */
647
- ensureFrameworksPhase(): BuildPhase;
694
+ ensureFrameworksPhase(): FrameworksBuildPhase;
648
695
  /**
649
696
  * The target's resources phase, created when missing.
650
697
  */
651
- ensureResourcesPhase(): BuildPhase;
698
+ ensureResourcesPhase(): ResourcesBuildPhase;
652
699
  /**
653
700
  * Embeds another target's product into this target through the
654
701
  * copy-files phase its product type calls for ("Embed Foundation
@@ -662,7 +709,7 @@ declare class NativeTarget extends Target<NativeTargetProperties> {
662
709
  * @returns The view of the embed phase, or `undefined` when the embedded
663
710
  * target has no product reference to embed.
664
711
  */
665
- embed(extension: NativeTarget): BuildPhase | undefined;
712
+ embed(extension: NativeTarget): CopyFilesBuildPhase | undefined;
666
713
  /**
667
714
  * The on-disk folder paths of the file-system-synchronized groups linked
668
715
  * to this target. Empty for targets without synchronized folders
@@ -697,7 +744,7 @@ declare class NativeTarget extends Target<NativeTargetProperties> {
697
744
  addSwiftPackageProduct(options: {
698
745
  productName: string;
699
746
  packageReference: XcodeObject;
700
- }): XcodeObject;
747
+ }): SwiftPackageProductDependency;
701
748
  /**
702
749
  * Links a system framework (for example `Messages`) to this target. It
703
750
  * reuses or creates the file reference under the SDK's frameworks
@@ -707,19 +754,22 @@ declare class NativeTarget extends Target<NativeTargetProperties> {
707
754
  * @param name Framework name without the `.framework` suffix.
708
755
  * @returns The view of the framework's file reference.
709
756
  */
710
- addSystemFramework(name: string): XcodeObject;
757
+ addSystemFramework(name: string): FileReference;
711
758
  }
712
759
  /**
713
760
  * An aggregate target produces nothing itself. It exists to group other
714
761
  * targets through its dependencies and to run script or copy-files
715
762
  * phases, and the shared target surface covers everything it carries.
716
763
  */
717
- declare class AggregateTarget extends Target {}
764
+ declare class AggregateTarget extends Target {
765
+ static readonly isa: string | null;
766
+ }
718
767
  /**
719
768
  * A legacy target shells out to an external build tool such as make
720
769
  * instead of using Xcode's build system.
721
770
  */
722
771
  declare class LegacyTarget extends Target<LegacyTargetProperties> {
772
+ static readonly isa: string | null;
723
773
  /**
724
774
  * The build tool the target invokes, as an absolute path.
725
775
  */
@@ -738,11 +788,11 @@ declare class LegacyTarget extends Target<LegacyTargetProperties> {
738
788
  //#region src/model/objects.d.ts
739
789
  /**
740
790
  * A `PBXGroup` is a folder in Xcode's navigator, holding references to
741
- * files and other groups. Variant groups (`PBXVariantGroup`) share this
742
- * view. The type parameter lets subclasses carry a more specific property
743
- * shape.
791
+ * files and other groups. The type parameter lets subclasses carry a more
792
+ * specific property shape.
744
793
  */
745
794
  declare class Group<Properties extends GroupProperties = GroupProperties> extends XcodeObject<Properties> {
795
+ static readonly isa: string | null;
746
796
  /**
747
797
  * Ids of the group's children, in navigator order. Non-string entries of
748
798
  * a malformed document are skipped.
@@ -784,11 +834,21 @@ declare class Group<Properties extends GroupProperties = GroupProperties> extend
784
834
  */
785
835
  createFile(path: string): XcodeObject;
786
836
  }
837
+ /**
838
+ * A `PBXVariantGroup` holds the localized variants of one file, one child
839
+ * per language. Everything else behaves like a plain group.
840
+ */
841
+ declare class VariantGroup extends Group {
842
+ static readonly isa: string | null;
843
+ }
787
844
  /**
788
845
  * A build phase is an ordered list of build files processed by one step
789
- * of a target's build. Every `PBX*BuildPhase` kind shares this view.
846
+ * of a target's build. Every `PBX*BuildPhase` kind extends this view, and
847
+ * kinds without a class of their own still map here through the factory's
848
+ * suffix fallback. The type parameter lets subclasses carry a more
849
+ * specific property shape.
790
850
  */
791
- declare class BuildPhase extends XcodeObject<BuildPhaseProperties> {
851
+ declare class BuildPhase<Properties extends BuildPhaseProperties = BuildPhaseProperties> extends XcodeObject<Properties> {
792
852
  /**
793
853
  * The phase's display name, when it carries an explicit one. Xcode names
794
854
  * copy-files and shell-script phases; the standard phases derive their
@@ -829,13 +889,102 @@ declare class BuildPhase extends XcodeObject<BuildPhaseProperties> {
829
889
  ensureBuildFile(reference: XcodeObject, options?: {
830
890
  referenceKey?: "fileRef" | "productRef";
831
891
  settings?: Record<string, string[] | string>;
832
- }): XcodeObject;
892
+ }): BuildFile;
893
+ }
894
+ /**
895
+ * A `PBXSourcesBuildPhase` compiles the target's source files.
896
+ */
897
+ declare class SourcesBuildPhase extends BuildPhase {
898
+ static readonly isa: string | null;
899
+ }
900
+ /**
901
+ * A `PBXFrameworksBuildPhase` links the target against frameworks,
902
+ * libraries, and Swift package products.
903
+ */
904
+ declare class FrameworksBuildPhase extends BuildPhase {
905
+ static readonly isa: string | null;
906
+ }
907
+ /**
908
+ * A `PBXResourcesBuildPhase` copies the target's resources into the
909
+ * built product.
910
+ */
911
+ declare class ResourcesBuildPhase extends BuildPhase {
912
+ static readonly isa: string | null;
913
+ }
914
+ /**
915
+ * A `PBXHeadersBuildPhase` installs a framework target's headers with
916
+ * their public, private, or project visibility.
917
+ */
918
+ declare class HeadersBuildPhase extends BuildPhase {
919
+ static readonly isa: string | null;
920
+ }
921
+ /**
922
+ * A `PBXCopyFilesBuildPhase` copies its build files to a destination
923
+ * inside the built product, which is how extensions and watch apps embed.
924
+ */
925
+ declare class CopyFilesBuildPhase extends BuildPhase<CopyFilesBuildPhaseProperties> {
926
+ static readonly isa: string | null;
927
+ /**
928
+ * The destination path inside the folder `dstSubfolderSpec` selects,
929
+ * when present.
930
+ */
931
+ get dstPath(): string | undefined;
932
+ }
933
+ /**
934
+ * A `PBXShellScriptBuildPhase` runs a script during the build.
935
+ */
936
+ declare class ShellScriptBuildPhase extends BuildPhase<ShellScriptBuildPhaseProperties> {
937
+ static readonly isa: string | null;
938
+ /**
939
+ * The script's source text, when present.
940
+ */
941
+ get shellScript(): string | undefined;
942
+ /**
943
+ * The interpreter the script runs under, when present. Xcode's default
944
+ * is `/bin/sh`.
945
+ */
946
+ get shellPath(): string | undefined;
947
+ }
948
+ /**
949
+ * A `PBXRezBuildPhase` runs Rez, the classic Mac OS resource compiler,
950
+ * over `.r` files. Xcode's UI called it "Build Carbon Resources".
951
+ * Current Xcode no longer creates these phases, but old documents still
952
+ * carry them.
953
+ */
954
+ declare class RezBuildPhase extends BuildPhase {
955
+ static readonly isa: string | null;
956
+ }
957
+ /**
958
+ * A `PBXAppleScriptBuildPhase` compiles AppleScript sources. Current
959
+ * Xcode no longer creates these, but old documents still carry them.
960
+ */
961
+ declare class AppleScriptBuildPhase extends BuildPhase {
962
+ static readonly isa: string | null;
963
+ }
964
+ /**
965
+ * A `PBXBuildFile` places one file reference or package product inside
966
+ * one build phase, optionally with per-file settings.
967
+ */
968
+ declare class BuildFile extends XcodeObject<BuildFileProperties> {
969
+ static readonly isa: string | null;
970
+ /**
971
+ * The view of the file reference the build file points at, when it
972
+ * points at one. Build files for Swift package products carry a
973
+ * `productRef` instead; see {@link productDependency}.
974
+ */
975
+ fileReference(): XcodeObject | undefined;
976
+ /**
977
+ * The view of the Swift package product dependency the build file
978
+ * points at, when it points at one.
979
+ */
980
+ productDependency(): SwiftPackageProductDependency | undefined;
833
981
  }
834
982
  /**
835
983
  * A `PBXFileSystemSynchronizedRootGroup` is an Xcode 16 folder whose
836
984
  * members are synchronized from disk instead of listed individually.
837
985
  */
838
986
  declare class SyncRootGroup extends XcodeObject<SyncRootGroupProperties> {
987
+ static readonly isa: string | null;
839
988
  /**
840
989
  * The group's on-disk folder path, when present.
841
990
  */
@@ -858,13 +1007,51 @@ declare class SyncRootGroup extends XcodeObject<SyncRootGroupProperties> {
858
1007
  * @param membershipExceptions File names inside the folder to exclude.
859
1008
  * @returns The view of the target's exception set for this folder.
860
1009
  */
861
- addMembershipExceptions(target: NativeTarget, membershipExceptions: string[]): XcodeObject;
1010
+ addMembershipExceptions(target: NativeTarget, membershipExceptions: string[]): BuildFileExceptionSet;
1011
+ }
1012
+ /**
1013
+ * Behavior shared by the synchronized-folder exception set kinds, which
1014
+ * carve files out of a folder's automatic membership for one target. The
1015
+ * type parameter lets subclasses carry a more specific property shape.
1016
+ */
1017
+ declare class ExceptionSet<Properties extends ExceptionSetProperties = ExceptionSetProperties> extends XcodeObject<Properties> {
1018
+ /**
1019
+ * The file names the set excludes, in declaration order. Non-string
1020
+ * entries of a malformed document are skipped.
1021
+ */
1022
+ get membershipExceptions(): string[];
1023
+ /**
1024
+ * The view of the target whose membership the set restricts, when the
1025
+ * reference resolves.
1026
+ */
1027
+ target(): XcodeObject | undefined;
1028
+ }
1029
+ /**
1030
+ * A `PBXFileSystemSynchronizedBuildFileExceptionSet` excludes files from
1031
+ * a synchronized folder's automatic target membership.
1032
+ */
1033
+ declare class BuildFileExceptionSet extends ExceptionSet {
1034
+ static readonly isa: string | null;
1035
+ }
1036
+ /**
1037
+ * A `PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet`
1038
+ * assigns some of a synchronized folder's files to a different build
1039
+ * phase than the automatic one.
1040
+ */
1041
+ declare class BuildPhaseMembershipExceptionSet extends ExceptionSet<BuildPhaseMembershipExceptionSetProperties> {
1042
+ static readonly isa: string | null;
1043
+ /**
1044
+ * The view of the build phase the listed files belong to, when the
1045
+ * reference resolves.
1046
+ */
1047
+ buildPhase(): BuildPhase | undefined;
862
1048
  }
863
1049
  /**
864
1050
  * A `PBXBuildRule` tells a target which compiler or script processes a
865
1051
  * kind of file.
866
1052
  */
867
1053
  declare class BuildRule extends XcodeObject<BuildRuleProperties> {
1054
+ static readonly isa: string | null;
868
1055
  /**
869
1056
  * The rule's script, when it is a script rule rather than a reference
870
1057
  * to a compiler specification.
@@ -877,6 +1064,7 @@ declare class BuildRule extends XcodeObject<BuildRuleProperties> {
877
1064
  * `currentVersion` names the active one.
878
1065
  */
879
1066
  declare class VersionGroup extends Group<VersionGroupProperties> {
1067
+ static readonly isa: string | null;
880
1068
  /**
881
1069
  * The view of the active model version's file reference, when the group
882
1070
  * names one.
@@ -888,11 +1076,153 @@ declare class VersionGroup extends Group<VersionGroupProperties> {
888
1076
  */
889
1077
  setCurrentVersion(reference: XcodeObject): void;
890
1078
  }
1079
+ /**
1080
+ * An `XCBuildConfiguration` holds one named settings dictionary of a
1081
+ * target or of the project, for example Debug or Release.
1082
+ */
1083
+ declare class BuildConfiguration extends XcodeObject<BuildConfigurationProperties> {
1084
+ static readonly isa: string | null;
1085
+ /**
1086
+ * The configuration's name, when present.
1087
+ */
1088
+ get name(): string | undefined;
1089
+ /**
1090
+ * The configuration's settings dictionary, typed with the keys
1091
+ * programmatic edits touch most, or `undefined` when the configuration
1092
+ * carries none. The dictionary is live. Writes through it land in the
1093
+ * document.
1094
+ */
1095
+ get buildSettings(): BuildSettings | undefined;
1096
+ }
1097
+ /**
1098
+ * A `PBXBuildStyle` is the pre-Xcode-2 predecessor of
1099
+ * `XCBuildConfiguration`. Current Xcode neither creates nor reads them,
1100
+ * but old documents still carry them.
1101
+ */
1102
+ declare class BuildStyle extends XcodeObject<BuildStyleProperties> {
1103
+ static readonly isa: string | null;
1104
+ /**
1105
+ * The style's name, when present.
1106
+ */
1107
+ get name(): string | undefined;
1108
+ /**
1109
+ * The style's settings dictionary, or `undefined` when the style
1110
+ * carries none. The dictionary is live. Writes through it land in the
1111
+ * document.
1112
+ */
1113
+ get buildSettings(): BuildSettings | undefined;
1114
+ }
1115
+ /**
1116
+ * A `PBXFileReference` names one file on disk, from source files to the
1117
+ * built products themselves.
1118
+ */
1119
+ declare class FileReference extends XcodeObject<FileReferenceProperties> {
1120
+ static readonly isa: string | null;
1121
+ /**
1122
+ * The reference's path, relative to its `sourceTree`, when present.
1123
+ */
1124
+ get path(): string | undefined;
1125
+ /**
1126
+ * The reference's display name, when it carries one distinct from the
1127
+ * path.
1128
+ */
1129
+ get name(): string | undefined;
1130
+ }
1131
+ /**
1132
+ * A `PBXContainerItemProxy` is the indirection Xcode places between a
1133
+ * target dependency and the target it points at.
1134
+ */
1135
+ declare class ContainerItemProxy extends XcodeObject<ContainerItemProxyProperties> {
1136
+ static readonly isa: string | null;
1137
+ /**
1138
+ * The display name of the object the proxy points at, when present.
1139
+ * For target dependencies this is the target's name.
1140
+ */
1141
+ get remoteInfo(): string | undefined;
1142
+ }
1143
+ /**
1144
+ * A `PBXTargetDependency` records that one target must build before
1145
+ * another, through a container item proxy naming the prerequisite.
1146
+ */
1147
+ declare class TargetDependency extends XcodeObject<TargetDependencyProperties> {
1148
+ static readonly isa: string | null;
1149
+ /**
1150
+ * The view of the target this dependency points at, when the reference
1151
+ * resolves to one inside this document.
1152
+ */
1153
+ target(): XcodeObject | undefined;
1154
+ /**
1155
+ * The view of the dependency's container item proxy, when the reference
1156
+ * resolves.
1157
+ */
1158
+ targetProxy(): ContainerItemProxy | undefined;
1159
+ }
1160
+ /**
1161
+ * An `XCConfigurationList` owns the named build configurations of one
1162
+ * target or of the project, plus the default configuration choice.
1163
+ */
1164
+ declare class ConfigurationList extends XcodeObject<ConfigurationListProperties> {
1165
+ static readonly isa: string | null;
1166
+ /**
1167
+ * The name of the configuration builds use when none is specified, when
1168
+ * present.
1169
+ */
1170
+ get defaultConfigurationName(): string | undefined;
1171
+ /**
1172
+ * The views of the list's build configurations, in list order. Dangling
1173
+ * ids and objects of other kinds are skipped.
1174
+ */
1175
+ configurations(): BuildConfiguration[];
1176
+ }
1177
+ /**
1178
+ * Behavior shared by the Swift package reference kinds. The type
1179
+ * parameter lets subclasses carry a more specific property shape.
1180
+ */
1181
+ declare class SwiftPackageReference<Properties extends SwiftPackageReferenceProperties = SwiftPackageReferenceProperties> extends XcodeObject<Properties> {}
1182
+ /**
1183
+ * An `XCRemoteSwiftPackageReference` names a package repository and a
1184
+ * version requirement.
1185
+ */
1186
+ declare class RemoteSwiftPackageReference extends SwiftPackageReference<RemoteSwiftPackageReferenceProperties> {
1187
+ static readonly isa: string | null;
1188
+ /**
1189
+ * The package's repository URL, when present.
1190
+ */
1191
+ get repositoryURL(): string | undefined;
1192
+ }
1193
+ /**
1194
+ * An `XCLocalSwiftPackageReference` names a package directory relative
1195
+ * to the project.
1196
+ */
1197
+ declare class LocalSwiftPackageReference extends SwiftPackageReference<LocalSwiftPackageReferenceProperties> {
1198
+ static readonly isa: string | null;
1199
+ /**
1200
+ * The package's path relative to the project, when present.
1201
+ */
1202
+ get relativePath(): string | undefined;
1203
+ }
1204
+ /**
1205
+ * An `XCSwiftPackageProductDependency` links one product of a Swift
1206
+ * package to the target that consumes it.
1207
+ */
1208
+ declare class SwiftPackageProductDependency extends XcodeObject<SwiftPackageProductDependencyProperties> {
1209
+ static readonly isa: string | null;
1210
+ /**
1211
+ * The product's name as the package manifest declares it, when present.
1212
+ */
1213
+ get productName(): string | undefined;
1214
+ /**
1215
+ * The view of the package reference the product comes from, when the
1216
+ * reference resolves. Products of local packages can omit it.
1217
+ */
1218
+ packageReference(): SwiftPackageReference | undefined;
1219
+ }
891
1220
  /**
892
1221
  * A `PBXReferenceProxy` stands in for a product built by a target of
893
1222
  * another project referenced from this one.
894
1223
  */
895
1224
  declare class ReferenceProxy extends XcodeObject<ReferenceProxyProperties> {
1225
+ static readonly isa: string | null;
896
1226
  /**
897
1227
  * The proxy's product path inside the other project's build directory,
898
1228
  * when present.
@@ -902,7 +1232,7 @@ declare class ReferenceProxy extends XcodeObject<ReferenceProxyProperties> {
902
1232
  * The view of the container item proxy that names the remote target,
903
1233
  * when the reference resolves.
904
1234
  */
905
- remoteReference(): XcodeObject | undefined;
1235
+ remoteReference(): ContainerItemProxy | undefined;
906
1236
  }
907
1237
  //#endregion
908
1238
  //#region src/model/project.d.ts
@@ -911,6 +1241,7 @@ declare class ReferenceProxy extends XcodeObject<ReferenceProxyProperties> {
911
1241
  * the main group, and the project-level configurations.
912
1242
  */
913
1243
  declare class RootProject extends XcodeObject<RootProjectProperties> {
1244
+ static readonly isa: string | null;
914
1245
  /**
915
1246
  * Ids of the project's targets, in project order.
916
1247
  */
@@ -930,7 +1261,7 @@ declare class RootProject extends XcodeObject<RootProjectProperties> {
930
1261
  * The views of the project's Swift package references, remote and local,
931
1262
  * in declaration order.
932
1263
  */
933
- packageReferences(): XcodeObject[];
1264
+ packageReferences(): SwiftPackageReference[];
934
1265
  /**
935
1266
  * The group product references live in, creating it (and registering it
936
1267
  * as the project's `productRefGroup`) when missing.
@@ -1086,7 +1417,7 @@ declare class XcodeProject {
1086
1417
  /**
1087
1418
  * Finds the remote Swift package reference for a repository URL.
1088
1419
  */
1089
- findSwiftPackage(repositoryUrl: string): XcodeObject | undefined;
1420
+ findSwiftPackage(repositoryUrl: string): RemoteSwiftPackageReference | undefined;
1090
1421
  /**
1091
1422
  * Adds a remote Swift package reference and registers it on the project.
1092
1423
  * When the project already references the repository, the existing
@@ -1103,11 +1434,11 @@ declare class XcodeProject {
1103
1434
  addSwiftPackage(options: {
1104
1435
  repositoryURL: string;
1105
1436
  requirement: Record<string, string>;
1106
- }): XcodeObject;
1437
+ }): RemoteSwiftPackageReference;
1107
1438
  /**
1108
1439
  * Finds the local Swift package reference for a directory path.
1109
1440
  */
1110
- findLocalSwiftPackage(relativePath: string): XcodeObject | undefined;
1441
+ findLocalSwiftPackage(relativePath: string): LocalSwiftPackageReference | undefined;
1111
1442
  /**
1112
1443
  * Adds a local (path-based) Swift package reference and registers it on
1113
1444
  * the project, returning the existing reference when the path is already
@@ -1117,13 +1448,13 @@ declare class XcodeProject {
1117
1448
  * @param relativePath The package directory, relative to the project.
1118
1449
  * @returns The view of the package reference for the path.
1119
1450
  */
1120
- addLocalSwiftPackage(relativePath: string): XcodeObject;
1451
+ addLocalSwiftPackage(relativePath: string): LocalSwiftPackageReference;
1121
1452
  /**
1122
1453
  * The views of every `PBXBuildFile` that points at the referenced object
1123
1454
  * through `fileRef` or `productRef`. Useful for relocating a product
1124
1455
  * between copy phases.
1125
1456
  */
1126
- buildFilesReferencing(reference: XcodeObject): XcodeObject[];
1457
+ buildFilesReferencing(reference: XcodeObject): BuildFile[];
1127
1458
  /**
1128
1459
  * Validates the document's object graph and returns every problem
1129
1460
  * found. An empty array means the graph is structurally sound. The
@@ -1188,8 +1519,10 @@ declare class XcodeProject {
1188
1519
  */
1189
1520
  findFileReference(projectRelativePath: string): XcodeObject | undefined;
1190
1521
  /**
1191
- * Creates the typed view for an object, dispatching on its isa. Objects
1192
- * outside the typed vocabulary get the generic base view.
1522
+ * Creates the typed view for an object, dispatching on the isa each
1523
+ * view class declares. Unknown `PBX*BuildPhase` kinds still map to
1524
+ * {@link BuildPhase}, and everything else outside the vocabulary gets
1525
+ * the generic base view.
1193
1526
  */
1194
1527
  private createView;
1195
1528
  }
@@ -1208,20 +1541,45 @@ declare class XcodeProject {
1208
1541
  * itself always reads through the narrowing accessors.
1209
1542
  */
1210
1543
  declare class XcodeObject<Properties extends PbxprojObject = PbxprojObject> {
1544
+ /**
1545
+ * The `isa` name this view class models. Each concrete view declares
1546
+ * its own, and the project's view factory dispatches on it, so the
1547
+ * class itself is the source of truth for which objects it covers.
1548
+ * Classes that only share behavior, like this base class and the
1549
+ * abstract target and phase bases, declare `null` and never route.
1550
+ */
1551
+ static readonly isa: string | null;
1211
1552
  /** The project this object belongs to. */
1212
1553
  readonly project: XcodeProject;
1213
1554
  /** The object's 24-character identifier (its key in `objects`). */
1214
1555
  readonly id: string;
1215
1556
  /**
1216
- * Views are created by the project's identity map; use
1557
+ * Views are created by the project's identity map. Use
1217
1558
  * {@link XcodeProject.get} or a typed query instead of constructing
1218
1559
  * views directly.
1219
1560
  */
1220
1561
  constructor(project: XcodeProject, id: string);
1221
1562
  /**
1222
- * The object's raw dictionary inside the document. Mutations through the
1223
- * model write here, and direct writes are equally valid; the model adds
1224
- * no caching over these properties.
1563
+ * Whether a value is a view of this class, narrowing it when so. Views
1564
+ * come typed out of the factory, and this is the readable way to
1565
+ * discriminate them when iterating mixed objects.
1566
+ *
1567
+ * ```ts
1568
+ * for (const [, object] of project.objects()) {
1569
+ * if (NativeTarget.is(object)) {
1570
+ * console.log(object.name);
1571
+ * }
1572
+ * }
1573
+ * ```
1574
+ *
1575
+ * Subclass views match their parent class too, the way `instanceof`
1576
+ * does, so a `VersionGroup` is a `Group`.
1577
+ */
1578
+ static is<Constructor extends abstract new (...args: never) => unknown>(this: Constructor, value: unknown): value is InstanceType<Constructor>;
1579
+ /**
1580
+ * The object's raw dictionary inside the document. Mutations through
1581
+ * the model write here, direct writes are equally valid, and the model
1582
+ * adds no caching over these properties.
1225
1583
  *
1226
1584
  * The typed shape is asserted, not checked. It describes what a
1227
1585
  * well-formed object of this kind carries (see `properties.ts`).
@@ -1285,19 +1643,20 @@ declare function parsePbxproj(text: string): PbxprojValue;
1285
1643
  /**
1286
1644
  * The node model of a scheme document.
1287
1645
  *
1288
- * A parsed `.xcscheme` is a tree of plain objects: elements with ordered
1289
- * attributes and child nodes, plus the occasional comment. All state lives
1290
- * in this tree. There is no wrapper class to keep in sync, so callers
1291
- * mutate nodes directly and serialize whatever the tree currently says.
1646
+ * A parsed `.xcscheme` is a tree of plain objects. Elements carry ordered
1647
+ * attributes and child nodes, and comments survive as their own nodes.
1648
+ * All state lives in this tree. There is no wrapper to keep in sync, so
1649
+ * callers mutate nodes directly and serialize whatever the tree currently
1650
+ * says.
1292
1651
  *
1293
1652
  * @module
1294
1653
  */
1295
1654
  /**
1296
1655
  * An XML element of a scheme document.
1297
1656
  *
1298
- * Attribute order is preserved and meaningful: the writer emits attributes
1299
- * in insertion order, which is how byte-identical round-trips of
1300
- * Xcode-written files fall out. Assigning an existing key keeps its
1657
+ * Attribute order is preserved and meaningful. The writer emits
1658
+ * attributes in insertion order, which is how Xcode-written files
1659
+ * round-trip byte-identically. Assigning an existing key keeps its
1301
1660
  * position, and adding a new key appends it.
1302
1661
  */
1303
1662
  interface XcschemeElement {
@@ -1322,9 +1681,10 @@ interface XcschemeComment {
1322
1681
  */
1323
1682
  type XcschemeNode = XcschemeElement | XcschemeComment;
1324
1683
  /**
1325
- * A parsed scheme file: its root element plus any comments sitting
1326
- * outside it. Xcode writes only the root, so the comment lists are almost
1327
- * always empty, but files that carry them round-trip without loss.
1684
+ * A parsed scheme file, made of its root element plus any comments
1685
+ * sitting outside it. Xcode writes only the root, so the comment lists
1686
+ * are almost always empty, but files that carry them round-trip without
1687
+ * loss.
1328
1688
  */
1329
1689
  interface XcschemeDocument {
1330
1690
  /** Comments before the root element. */
@@ -1354,14 +1714,99 @@ declare function buildXcscheme(document: XcschemeDocument): string;
1354
1714
  * Collects elements of the given name anywhere in the tree, in document
1355
1715
  * order, the subtree root included. Passing no name collects every
1356
1716
  * element.
1717
+ */
1718
+ declare function xcschemeElements(root: XcschemeElement, name?: string): XcschemeElement[];
1719
+ /**
1720
+ * A `BuildableReference` element with property-style attribute access.
1721
+ *
1722
+ * Buildable references are the elements editing flows touch most, since
1723
+ * every action points at its target through one. The view reads and
1724
+ * writes the element's attributes directly, so it never goes stale and
1725
+ * needs no separate save step.
1726
+ */
1727
+ declare class BuildableReference {
1728
+ /** The underlying element inside the document tree. */
1729
+ readonly element: XcschemeElement;
1730
+ constructor(element: XcschemeElement);
1731
+ /**
1732
+ * The referenced target's object id in the project document, when
1733
+ * present. Xcode repairs a missing or stale identifier on first open.
1734
+ */
1735
+ get blueprintIdentifier(): string | undefined;
1736
+ set blueprintIdentifier(value: string);
1737
+ /**
1738
+ * The referenced target's name, when present.
1739
+ */
1740
+ get blueprintName(): string | undefined;
1741
+ set blueprintName(value: string);
1742
+ /**
1743
+ * The built product's file name, for example `DemoApp.app`, when
1744
+ * present.
1745
+ */
1746
+ get buildableName(): string | undefined;
1747
+ set buildableName(value: string);
1748
+ /**
1749
+ * The container the target lives in, for example
1750
+ * `container:DemoApp.xcodeproj`, when present.
1751
+ */
1752
+ get referencedContainer(): string | undefined;
1753
+ set referencedContainer(value: string);
1754
+ }
1755
+ /**
1756
+ * A scheme document with typed access to the elements editing flows
1757
+ * touch.
1758
+ *
1759
+ * The model is a thin layer over the node tree. All state lives in the
1760
+ * document itself, and {@link build} serializes whatever the tree
1761
+ * currently says, so typed edits and direct tree edits compose freely.
1357
1762
  *
1358
1763
  * ```ts
1359
- * for (const reference of xcschemeElements(scheme.root, "BuildableReference")) {
1360
- * reference.attributes["BlueprintName"] = "RenamedApp";
1764
+ * const scheme = Xcscheme.parse(xcschemeText);
1765
+ * for (const reference of scheme.buildableReferences()) {
1766
+ * reference.blueprintName = "RenamedApp";
1767
+ * reference.buildableName = "RenamedApp.app";
1361
1768
  * }
1769
+ * const text = scheme.build();
1362
1770
  * ```
1363
1771
  */
1364
- declare function xcschemeElements(root: XcschemeElement, name?: string): XcschemeElement[];
1772
+ declare class Xcscheme {
1773
+ /** The underlying parsed document. */
1774
+ readonly document: XcschemeDocument;
1775
+ constructor(document: XcschemeDocument);
1776
+ /**
1777
+ * Parses the text of a `.xcscheme` file into a scheme model.
1778
+ *
1779
+ * @throws XcschemeParseError when the text is not a well-formed scheme
1780
+ * document, with the line and column of the failure.
1781
+ */
1782
+ static parse(text: string): Xcscheme;
1783
+ /**
1784
+ * Creates the scheme Xcode writes for an application target. See
1785
+ * {@link createXcscheme} for the shape it produces.
1786
+ */
1787
+ static create(options: CreateXcschemeOptions): Xcscheme;
1788
+ /**
1789
+ * The document's `Scheme` element.
1790
+ */
1791
+ get root(): XcschemeElement;
1792
+ /**
1793
+ * Serializes the scheme to the text of a `.xcscheme` file in Xcode's
1794
+ * canonical layout.
1795
+ */
1796
+ build(): string;
1797
+ /**
1798
+ * Collects elements of the given name anywhere in the document, in
1799
+ * document order. Passing no name collects every element.
1800
+ */
1801
+ elements(name?: string): XcschemeElement[];
1802
+ /**
1803
+ * The views of every buildable reference in the document, in document
1804
+ * order. Build entries, testables, macro expansions, runnables, and
1805
+ * action environment buildables all point at their target through one
1806
+ * of these, so rename flows iterate this list.
1807
+ */
1808
+ buildableReferences(): BuildableReference[];
1809
+ }
1365
1810
  /**
1366
1811
  * Options for {@link createXcscheme}.
1367
1812
  */
@@ -1381,10 +1826,11 @@ interface CreateXcschemeOptions {
1381
1826
  blueprintIdentifier?: string;
1382
1827
  }
1383
1828
  /**
1384
- * Creates the scheme Xcode writes for an application target: build,
1385
- * launch, profile, analyze, and archive actions wired to the app product,
1386
- * with Xcode's default configuration choices (Debug for development
1387
- * actions, Release for profiling and archiving).
1829
+ * Creates the scheme Xcode writes for an application target. The
1830
+ * document carries build, launch, profile, analyze, and archive actions
1831
+ * wired to the app product, with Xcode's default configuration choices
1832
+ * of Debug for development actions and Release for profiling and
1833
+ * archiving.
1388
1834
  */
1389
1835
  declare function createXcscheme(options: CreateXcschemeOptions): XcschemeDocument;
1390
1836
  //#endregion
@@ -1424,4 +1870,4 @@ declare function parseXcscheme(text: string): XcschemeDocument;
1424
1870
  */
1425
1871
  declare function generateObjectId(seed: string, existing: ReadonlySet<string>): string;
1426
1872
  //#endregion
1427
- export { type AddNativeTargetOptions, AggregateTarget, type ApplePlatform, type BuildConfigurationProperties, type BuildFileProperties, BuildPhase, type BuildPhaseProperties, BuildRule, type BuildRuleProperties, type BuildSettings, type ConfigurationListProperties, type ContainerItemProxyProperties, CopyFilesDestination, type CreateXcschemeOptions, type ExceptionSetProperties, type FileReferenceProperties, Group, type GroupProperties, Isa, LegacyTarget, type LegacyTargetProperties, NativeTarget, type NativeTargetProperties, type PbxprojArray, PbxprojBuildError, type PbxprojErrorPosition, type PbxprojObject, PbxprojParseError, type PbxprojValue, ProductType, type ProjectIssue, type ProjectIssueKind, ReferenceProxy, type ReferenceProxyProperties, RootProject, type RootProjectProperties, type SwiftPackageProductDependencyProperties, type SwiftPackageReferenceProperties, SyncRootGroup, type SyncRootGroupProperties, Target, type TargetDependencyProperties, type TargetProperties, VersionGroup, type VersionGroupProperties, XcodeModelError, XcodeObject, XcodeProject, XcschemeBuildError, type XcschemeComment, type XcschemeDocument, type XcschemeElement, type XcschemeNode, XcschemeParseError, buildPbxproj, buildXcscheme, createXcscheme, generateObjectId, isXcschemeElement, parsePbxproj, parseXcscheme, xcschemeElements };
1873
+ export { type AddNativeTargetOptions, AggregateTarget, type ApplePlatform, AppleScriptBuildPhase, BuildConfiguration, type BuildConfigurationProperties, BuildFile, BuildFileExceptionSet, type BuildFileProperties, BuildPhase, BuildPhaseMembershipExceptionSet, type BuildPhaseMembershipExceptionSetProperties, type BuildPhaseProperties, BuildRule, type BuildRuleProperties, type BuildSettings, BuildStyle, type BuildStyleProperties, BuildableReference, ConfigurationList, type ConfigurationListProperties, ContainerItemProxy, type ContainerItemProxyProperties, CopyFilesBuildPhase, type CopyFilesBuildPhaseProperties, CopyFilesDestination, type CreateXcschemeOptions, ExceptionSet, type ExceptionSetProperties, FileReference, type FileReferenceProperties, FrameworksBuildPhase, Group, type GroupProperties, HeadersBuildPhase, Isa, LegacyTarget, type LegacyTargetProperties, LocalSwiftPackageReference, type LocalSwiftPackageReferenceProperties, NativeTarget, type NativeTargetProperties, type PbxprojArray, PbxprojBuildError, type PbxprojErrorPosition, type PbxprojObject, PbxprojParseError, type PbxprojValue, ProductType, type ProjectIssue, type ProjectIssueKind, ReferenceProxy, type ReferenceProxyProperties, RemoteSwiftPackageReference, type RemoteSwiftPackageReferenceProperties, ResourcesBuildPhase, RezBuildPhase, RootProject, type RootProjectProperties, ShellScriptBuildPhase, type ShellScriptBuildPhaseProperties, SourcesBuildPhase, SwiftPackageProductDependency, type SwiftPackageProductDependencyProperties, SwiftPackageReference, type SwiftPackageReferenceProperties, SyncRootGroup, type SyncRootGroupProperties, Target, TargetDependency, type TargetDependencyProperties, type TargetProperties, VariantGroup, VersionGroup, type VersionGroupProperties, XcodeModelError, XcodeObject, XcodeProject, Xcscheme, XcschemeBuildError, type XcschemeComment, type XcschemeDocument, type XcschemeElement, type XcschemeNode, XcschemeParseError, buildPbxproj, buildXcscheme, createXcscheme, generateObjectId, isXcschemeElement, parsePbxproj, parseXcscheme, xcschemeElements };