rork-xcode 0.1.0 → 0.3.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
@@ -114,6 +114,58 @@ declare class PbxprojParseError extends Error {
114
114
  */
115
115
  constructor(message: string, source: string, offset: number);
116
116
  }
117
+ /**
118
+ * Thrown when the source text is not a well-formed scheme document (the
119
+ * XML dialect of `.xcscheme` files).
120
+ *
121
+ * The message always embeds the line and column of the failure, and the
122
+ * same information is available in structured form on {@link position}
123
+ * for programmatic use.
124
+ */
125
+ declare class XcschemeParseError extends Error {
126
+ /** Where in the source text parsing failed. */
127
+ readonly position: PbxprojErrorPosition;
128
+ /**
129
+ * @param message Failure description without location; the location is
130
+ * appended automatically.
131
+ * @param source Full source text, used to compute the position.
132
+ * @param offset Character offset of the failure inside `source`.
133
+ */
134
+ constructor(message: string, source: string, offset: number);
135
+ }
136
+ /**
137
+ * Thrown when a scheme element cannot be written as XML.
138
+ *
139
+ * Raised for element and attribute names that are not valid XML names and
140
+ * for attribute values carrying control characters XML 1.0 cannot encode.
141
+ * The {@link path} pinpoints the offending element inside the tree.
142
+ */
143
+ declare class XcschemeBuildError extends Error {
144
+ /** Path to the offending element from the root, e.g. `Scheme.BuildAction[0]`. */
145
+ readonly path: string;
146
+ /**
147
+ * @param message Failure description without location; the element path
148
+ * is appended automatically.
149
+ * @param path Path to the offending element from the root.
150
+ */
151
+ constructor(message: string, path: string);
152
+ }
153
+ /**
154
+ * Thrown by the object model when an operation cannot proceed: the
155
+ * document lacks the structure the operation needs (no objects dictionary,
156
+ * no root project object), a view's object was removed from the document,
157
+ * or a creation request names a product type the model cannot scaffold.
158
+ *
159
+ * Read paths in the model return `undefined` for merely malformed data;
160
+ * this error marks the cases where continuing would corrupt the document
161
+ * or hide a programming mistake.
162
+ */
163
+ declare class XcodeModelError extends Error {
164
+ /**
165
+ * @param message Description of the failed operation.
166
+ */
167
+ constructor(message: string);
168
+ }
117
169
  /**
118
170
  * Thrown when a value cannot be represented in a `project.pbxproj` document.
119
171
  *
@@ -135,6 +187,1083 @@ declare class PbxprojBuildError extends Error {
135
187
  constructor(message: string, path: string);
136
188
  }
137
189
  //#endregion
190
+ //#region src/model/isa.d.ts
191
+ /**
192
+ * Names and well-known values of the pbxproj object vocabulary.
193
+ *
194
+ * Everything here mirrors strings Xcode itself writes; nothing is invented.
195
+ * Centralizing them keeps the object model free of string literals and
196
+ * gives call sites one place to import from.
197
+ *
198
+ * @module
199
+ */
200
+ /**
201
+ * The `isa` names the object model works with. The parser and serializer
202
+ * accept any isa; this list only covers the kinds the model creates or
203
+ * gives typed access to.
204
+ */
205
+ declare const Isa: {
206
+ readonly aggregateTarget: "PBXAggregateTarget";
207
+ readonly buildFile: "PBXBuildFile";
208
+ readonly buildRule: "PBXBuildRule";
209
+ readonly containerItemProxy: "PBXContainerItemProxy";
210
+ readonly copyFilesBuildPhase: "PBXCopyFilesBuildPhase";
211
+ readonly fileReference: "PBXFileReference";
212
+ readonly fileSystemSynchronizedBuildFileExceptionSet: "PBXFileSystemSynchronizedBuildFileExceptionSet";
213
+ readonly fileSystemSynchronizedRootGroup: "PBXFileSystemSynchronizedRootGroup";
214
+ readonly frameworksBuildPhase: "PBXFrameworksBuildPhase";
215
+ readonly group: "PBXGroup";
216
+ readonly legacyTarget: "PBXLegacyTarget";
217
+ readonly nativeTarget: "PBXNativeTarget";
218
+ readonly project: "PBXProject";
219
+ readonly referenceProxy: "PBXReferenceProxy";
220
+ readonly resourcesBuildPhase: "PBXResourcesBuildPhase";
221
+ readonly sourcesBuildPhase: "PBXSourcesBuildPhase";
222
+ readonly targetDependency: "PBXTargetDependency";
223
+ readonly variantGroup: "PBXVariantGroup";
224
+ readonly buildConfiguration: "XCBuildConfiguration";
225
+ readonly configurationList: "XCConfigurationList";
226
+ readonly localSwiftPackageReference: "XCLocalSwiftPackageReference";
227
+ readonly remoteSwiftPackageReference: "XCRemoteSwiftPackageReference";
228
+ readonly swiftPackageProductDependency: "XCSwiftPackageProductDependency";
229
+ readonly versionGroup: "XCVersionGroup";
230
+ };
231
+ /**
232
+ * Product type identifiers of the targets the model creates or reasons
233
+ * about. Other product types pass through untouched.
234
+ */
235
+ declare const ProductType: {
236
+ readonly application: "com.apple.product-type.application";
237
+ readonly messagesApplication: "com.apple.product-type.application.messages";
238
+ readonly appExtension: "com.apple.product-type.app-extension";
239
+ readonly messagesExtension: "com.apple.product-type.app-extension.messages";
240
+ readonly extensionKitExtension: "com.apple.product-type.extensionkit-extension";
241
+ readonly onDemandInstallCapableApplication: "com.apple.product-type.application.on-demand-install-capable";
242
+ readonly watchApp: "com.apple.product-type.application.watchapp2";
243
+ };
244
+ /**
245
+ * The Apple platforms the model can resolve a main application target for.
246
+ */
247
+ type ApplePlatform = "ios" | "macos" | "tvos" | "watchos" | "visionos";
248
+ /**
249
+ * `dstSubfolderSpec` values for copy-files build phases, named after the
250
+ * destination each selects.
251
+ */
252
+ declare const CopyFilesDestination: {
253
+ readonly plugins: 13;
254
+ readonly productsDirectory: 16;
255
+ };
256
+ //#endregion
257
+ //#region src/model/doctor.d.ts
258
+ /**
259
+ * The kinds of problem {@link validateProject} reports.
260
+ *
261
+ * - `dangling-root`: the document's `rootObject` is missing or does not
262
+ * resolve to a `PBXProject`.
263
+ * - `missing-isa`: an object carries no kind, which Xcode cannot read.
264
+ * - `dangling-reference`: a known reference property points at an id the
265
+ * document does not contain.
266
+ * - `unreachable-object`: nothing on the path from the root references
267
+ * the object. Xcode ignores such orphans, and
268
+ * {@link pruneOrphanObjects} removes them.
269
+ */
270
+ type ProjectIssueKind = "dangling-root" | "missing-isa" | "dangling-reference" | "unreachable-object";
271
+ /**
272
+ * One problem found by {@link validateProject}.
273
+ */
274
+ interface ProjectIssue {
275
+ /** The problem's kind, one of {@link ProjectIssueKind}. */
276
+ kind: ProjectIssueKind;
277
+ /** Human-readable description with the involved ids and properties. */
278
+ message: string;
279
+ /** The object the problem sits on, when it sits on one. */
280
+ objectId?: string;
281
+ }
282
+ //#endregion
283
+ //#region src/model/properties.d.ts
284
+ /**
285
+ * Build settings of one configuration. The named keys are the ones
286
+ * programmatic edits touch most. Projects carry many more, and all of
287
+ * them stay accessible through the index signature.
288
+ */
289
+ interface BuildSettings extends PbxprojObject {
290
+ ASSETCATALOG_COMPILER_APPICON_NAME?: string;
291
+ CODE_SIGN_ENTITLEMENTS?: string;
292
+ CODE_SIGN_IDENTITY?: string;
293
+ CODE_SIGN_STYLE?: string;
294
+ CURRENT_PROJECT_VERSION?: number | string;
295
+ DEVELOPMENT_TEAM?: string;
296
+ GENERATE_INFOPLIST_FILE?: string;
297
+ INFOPLIST_FILE?: string;
298
+ IPHONEOS_DEPLOYMENT_TARGET?: string;
299
+ LD_RUNPATH_SEARCH_PATHS?: string;
300
+ MACOSX_DEPLOYMENT_TARGET?: string;
301
+ MARKETING_VERSION?: number | string;
302
+ PRODUCT_BUNDLE_IDENTIFIER?: string;
303
+ PRODUCT_NAME?: string;
304
+ PROVISIONING_PROFILE_SPECIFIER?: string;
305
+ SDKROOT?: string;
306
+ SKIP_INSTALL?: string;
307
+ SUPPORTED_PLATFORMS?: string;
308
+ SWIFT_VERSION?: string;
309
+ TARGETED_DEVICE_FAMILY?: number | string;
310
+ TVOS_DEPLOYMENT_TARGET?: string;
311
+ WATCHOS_DEPLOYMENT_TARGET?: string;
312
+ XROS_DEPLOYMENT_TARGET?: string;
313
+ }
314
+ /**
315
+ * Properties shared by every target kind. Native, aggregate, and legacy
316
+ * targets all carry a name, a configuration list, build phases, and
317
+ * dependencies.
318
+ */
319
+ interface TargetProperties extends PbxprojObject {
320
+ buildConfigurationList?: string;
321
+ buildPhases?: string[];
322
+ dependencies?: string[];
323
+ name?: string;
324
+ productName?: string;
325
+ }
326
+ /**
327
+ * Properties of a `PBXNativeTarget`.
328
+ */
329
+ interface NativeTargetProperties extends TargetProperties {
330
+ buildRules?: string[];
331
+ fileSystemSynchronizedGroups?: string[];
332
+ packageProductDependencies?: string[];
333
+ productReference?: string;
334
+ productType?: string;
335
+ }
336
+ /**
337
+ * Properties of a `PBXLegacyTarget`, a target that shells out to an
338
+ * external build tool such as make.
339
+ */
340
+ interface LegacyTargetProperties extends TargetProperties {
341
+ buildArgumentsString?: string;
342
+ buildToolPath?: string;
343
+ buildWorkingDirectory?: string;
344
+ passBuildSettingsInEnvironment?: number;
345
+ }
346
+ /**
347
+ * Properties of a `PBXBuildRule`, a per-target rule mapping a file kind to
348
+ * the compiler or script that processes it.
349
+ */
350
+ interface BuildRuleProperties extends PbxprojObject {
351
+ compilerSpec?: string;
352
+ filePatterns?: string;
353
+ fileType?: string;
354
+ inputFiles?: string[];
355
+ isEditable?: number;
356
+ name?: string;
357
+ outputFiles?: string[];
358
+ runOncePerArchitecture?: number;
359
+ script?: string;
360
+ }
361
+ /**
362
+ * Properties of the root `PBXProject` object.
363
+ */
364
+ interface RootProjectProperties extends PbxprojObject {
365
+ attributes?: PbxprojObject;
366
+ buildConfigurationList?: string;
367
+ developmentRegion?: string;
368
+ knownRegions?: string[];
369
+ mainGroup?: string;
370
+ packageReferences?: string[];
371
+ productRefGroup?: string;
372
+ projectDirPath?: string;
373
+ projectRoot?: string;
374
+ targets?: string[];
375
+ }
376
+ /**
377
+ * Properties of a `PBXGroup` or `PBXVariantGroup`.
378
+ */
379
+ interface GroupProperties extends PbxprojObject {
380
+ children?: string[];
381
+ name?: string;
382
+ path?: string;
383
+ sourceTree?: string;
384
+ }
385
+ /**
386
+ * Properties of an `XCVersionGroup`, the container of a versioned Core
387
+ * Data model (`.xcdatamodeld`). Its children are the model versions and
388
+ * `currentVersion` names the active one.
389
+ */
390
+ interface VersionGroupProperties extends GroupProperties {
391
+ currentVersion?: string;
392
+ versionGroupType?: string;
393
+ }
394
+ /**
395
+ * Properties of a `PBXReferenceProxy`, the stand-in for a product built
396
+ * by a target of another project referenced from this one.
397
+ */
398
+ interface ReferenceProxyProperties extends PbxprojObject {
399
+ fileType?: string;
400
+ name?: string;
401
+ path?: string;
402
+ remoteRef?: string;
403
+ sourceTree?: string;
404
+ }
405
+ /**
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.
409
+ */
410
+ interface BuildPhaseProperties extends PbxprojObject {
411
+ buildActionMask?: number;
412
+ dstPath?: string;
413
+ dstSubfolderSpec?: number;
414
+ files?: string[];
415
+ inputFileListPaths?: string[];
416
+ inputPaths?: string[];
417
+ name?: string;
418
+ outputFileListPaths?: string[];
419
+ outputPaths?: string[];
420
+ runOnlyForDeploymentPostprocessing?: number;
421
+ shellPath?: string;
422
+ shellScript?: string;
423
+ }
424
+ /**
425
+ * Properties of a `PBXFileSystemSynchronizedRootGroup`.
426
+ */
427
+ interface SyncRootGroupProperties extends PbxprojObject {
428
+ exceptions?: string[];
429
+ explicitFileTypes?: PbxprojObject;
430
+ explicitFolders?: string[];
431
+ path?: string;
432
+ sourceTree?: string;
433
+ }
434
+ /**
435
+ * Properties of a `PBXFileReference`.
436
+ */
437
+ interface FileReferenceProperties extends PbxprojObject {
438
+ explicitFileType?: string;
439
+ fileEncoding?: number;
440
+ includeInIndex?: number;
441
+ lastKnownFileType?: string;
442
+ name?: string;
443
+ path?: string;
444
+ sourceTree?: string;
445
+ }
446
+ /**
447
+ * Properties of a `PBXBuildFile`.
448
+ */
449
+ interface BuildFileProperties extends PbxprojObject {
450
+ fileRef?: string;
451
+ productRef?: string;
452
+ settings?: PbxprojObject;
453
+ }
454
+ /**
455
+ * Properties of an `XCBuildConfiguration`.
456
+ */
457
+ interface BuildConfigurationProperties extends PbxprojObject {
458
+ baseConfigurationReference?: string;
459
+ buildSettings?: BuildSettings;
460
+ name?: string;
461
+ }
462
+ /**
463
+ * Properties of an `XCConfigurationList`.
464
+ */
465
+ interface ConfigurationListProperties extends PbxprojObject {
466
+ buildConfigurations?: string[];
467
+ defaultConfigurationIsVisible?: number;
468
+ defaultConfigurationName?: string;
469
+ }
470
+ /**
471
+ * Properties of a `PBXTargetDependency`.
472
+ */
473
+ interface TargetDependencyProperties extends PbxprojObject {
474
+ name?: string;
475
+ target?: string;
476
+ targetProxy?: string;
477
+ }
478
+ /**
479
+ * Properties of a `PBXContainerItemProxy`.
480
+ */
481
+ interface ContainerItemProxyProperties extends PbxprojObject {
482
+ containerPortal?: string;
483
+ proxyType?: number;
484
+ remoteGlobalIDString?: string;
485
+ remoteInfo?: string;
486
+ }
487
+ /**
488
+ * Properties of an `XCRemoteSwiftPackageReference` or
489
+ * `XCLocalSwiftPackageReference`. Remote references carry the repository
490
+ * and requirement. Local ones carry the relative path.
491
+ */
492
+ interface SwiftPackageReferenceProperties extends PbxprojObject {
493
+ relativePath?: string;
494
+ repositoryURL?: string;
495
+ requirement?: PbxprojObject;
496
+ }
497
+ /**
498
+ * Properties of an `XCSwiftPackageProductDependency`.
499
+ */
500
+ interface SwiftPackageProductDependencyProperties extends PbxprojObject {
501
+ package?: string;
502
+ productName?: string;
503
+ }
504
+ /**
505
+ * Properties of a `PBXFileSystemSynchronizedBuildFileExceptionSet` or its
506
+ * build-phase-membership variant.
507
+ */
508
+ interface ExceptionSetProperties extends PbxprojObject {
509
+ buildPhase?: string;
510
+ membershipExceptions?: string[];
511
+ target?: string;
512
+ }
513
+ //#endregion
514
+ //#region src/model/target.d.ts
515
+ /**
516
+ * The behavior every target kind shares. A target of any kind carries
517
+ * build configurations and settings, build phases, and dependencies, and
518
+ * this class holds their accessors and mutations. `PBXNativeTarget`,
519
+ * `PBXAggregateTarget`, and `PBXLegacyTarget` all extend it, so code that
520
+ * walks or rewires targets can accept any of them.
521
+ */
522
+ declare class Target<Properties extends TargetProperties = TargetProperties> extends XcodeObject<Properties> {
523
+ /**
524
+ * The target's name, when present.
525
+ */
526
+ get name(): string | undefined;
527
+ /**
528
+ * The views of the target's build configurations, in list order.
529
+ */
530
+ buildConfigurations(): XcodeObject[];
531
+ /**
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.
536
+ */
537
+ defaultConfigurationSettings(): PbxprojObject | undefined;
538
+ /**
539
+ * Reads a build setting from the target's default configuration,
540
+ * inheriting from the project-level configuration when the target omits
541
+ * the key. This mirrors how Xcode resolves settings hierarchically;
542
+ * generated app templates set values like `SDKROOT` only at the project
543
+ * level.
544
+ *
545
+ * Only string values are returned; a list- or number-valued setting reads
546
+ * as `undefined`.
547
+ */
548
+ getBuildSetting(key: string): string | undefined;
549
+ /**
550
+ * Writes a build setting on every configuration of the target, so Debug
551
+ * and Release stay consistent.
552
+ */
553
+ setBuildSetting(key: string, value: string): void;
554
+ /**
555
+ * Removes a build setting from every configuration of the target.
556
+ */
557
+ removeBuildSetting(key: string): void;
558
+ /**
559
+ * The views of the target's dependency objects
560
+ * (`PBXTargetDependency`), in declaration order. Resolve a dependency's
561
+ * target through its `target` property.
562
+ */
563
+ dependencies(): XcodeObject[];
564
+ /**
565
+ * The views of the target's build phases, in build order.
566
+ */
567
+ buildPhases(): BuildPhase[];
568
+ /**
569
+ * Finds the target's first build phase with the given isa, and, when
570
+ * `name` is provided, the given display name.
571
+ */
572
+ findBuildPhase(isa: string, name?: string): BuildPhase | undefined;
573
+ /**
574
+ * Returns the target's build phase with the given isa and properties,
575
+ * creating and appending it when missing. The properties apply only on
576
+ * creation; an existing phase is returned as is.
577
+ *
578
+ * The match key is the isa plus the `name` property when one is given,
579
+ * so differently named copy-files phases coexist.
580
+ */
581
+ ensureBuildPhase(isa: string, properties?: PbxprojObject): BuildPhase;
582
+ /**
583
+ * The target's shell-script phase with the given name, created with the
584
+ * usual defaults (`/bin/sh`, empty input and output lists) when missing.
585
+ * The script and other properties apply only on creation.
586
+ *
587
+ * @param name Display name of the phase, which is also its match key.
588
+ * @param properties Phase properties, most usefully `shellScript`.
589
+ */
590
+ ensureShellScriptPhase(name: string, properties?: PbxprojObject): BuildPhase;
591
+ /**
592
+ * Adds a dependency on another target of the same project, wiring the
593
+ * `PBXContainerItemProxy` and `PBXTargetDependency` pair Xcode uses to
594
+ * express it. Adding an existing dependency is a no-op.
595
+ *
596
+ * @returns The view of the target dependency object.
597
+ */
598
+ addDependency(dependency: Target): XcodeObject;
599
+ }
600
+ /**
601
+ * A `PBXNativeTarget` is a product the project compiles and packages
602
+ * itself, such as an application or an app extension.
603
+ */
604
+ declare class NativeTarget extends Target<NativeTargetProperties> {
605
+ /**
606
+ * The target's product type identifier, for example
607
+ * `com.apple.product-type.application`.
608
+ */
609
+ get productType(): string | undefined;
610
+ /**
611
+ * Rewrites the target's product type. Used by packaging repairs that
612
+ * convert foundation extensions into ExtensionKit extensions.
613
+ */
614
+ set productType(value: string);
615
+ /**
616
+ * The view of the target's product file reference, when the target has
617
+ * one.
618
+ */
619
+ get productReference(): XcodeObject | undefined;
620
+ /**
621
+ * Whether the target builds for watchOS, decided by its product type or
622
+ * its watchOS deployment-target setting.
623
+ */
624
+ isWatchOS(): boolean;
625
+ /**
626
+ * The views of the target's Swift package product dependencies, in
627
+ * declaration order.
628
+ */
629
+ packageProductDependencies(): XcodeObject[];
630
+ /**
631
+ * The views of the target's file-system-synchronized folders, in
632
+ * declaration order.
633
+ */
634
+ syncGroups(): SyncRootGroup[];
635
+ /**
636
+ * The views of the target's build rules, in evaluation order. Empty for
637
+ * targets without custom rules, which is nearly all of them.
638
+ */
639
+ buildRules(): BuildRule[];
640
+ /**
641
+ * The target's sources phase, created when missing.
642
+ */
643
+ ensureSourcesPhase(): BuildPhase;
644
+ /**
645
+ * The target's frameworks phase, created when missing.
646
+ */
647
+ ensureFrameworksPhase(): BuildPhase;
648
+ /**
649
+ * The target's resources phase, created when missing.
650
+ */
651
+ ensureResourcesPhase(): BuildPhase;
652
+ /**
653
+ * Embeds another target's product into this target through the
654
+ * copy-files phase its product type calls for ("Embed Foundation
655
+ * Extensions", "Embed App Clips", "Embed Watch Content", or "Embed
656
+ * ExtensionKit Extensions").
657
+ *
658
+ * An existing phase with the same name is reused, its destination is
659
+ * repaired to the type's canonical values, and the product's build file
660
+ * is deduplicated, so embedding is idempotent.
661
+ *
662
+ * @returns The view of the embed phase, or `undefined` when the embedded
663
+ * target has no product reference to embed.
664
+ */
665
+ embed(extension: NativeTarget): BuildPhase | undefined;
666
+ /**
667
+ * The on-disk folder paths of the file-system-synchronized groups linked
668
+ * to this target. Empty for targets without synchronized folders
669
+ * (projects predating Xcode 16).
670
+ */
671
+ syncGroupPaths(): string[];
672
+ /**
673
+ * Creates a file-system-synchronized folder for an on-disk path, links it
674
+ * to this target, and registers it in the project's main group so Xcode
675
+ * shows it in the navigator. When the target already links a folder with
676
+ * the same path, that folder is returned instead, so re-running a
677
+ * scaffold step cannot duplicate groups.
678
+ *
679
+ * @param path Folder path relative to the project root, for example the
680
+ * target's name.
681
+ * @returns The view of the target's synchronized folder for the path.
682
+ */
683
+ addSyncGroup(path: string): SyncRootGroup;
684
+ /**
685
+ * Links a Swift package product to this target. It creates the
686
+ * `XCSwiftPackageProductDependency`, registers it on the target, and
687
+ * ensures the frameworks phase carries its build file. Linking an
688
+ * already linked product is a no-op.
689
+ *
690
+ * @param options.productName The product to link, as the package
691
+ * manifest names it.
692
+ * @param options.packageReference The package reference view returned by
693
+ * {@link XcodeProject.addSwiftPackage} or
694
+ * {@link XcodeProject.findSwiftPackage}.
695
+ * @returns The view of the product dependency.
696
+ */
697
+ addSwiftPackageProduct(options: {
698
+ productName: string;
699
+ packageReference: XcodeObject;
700
+ }): XcodeObject;
701
+ /**
702
+ * Links a system framework (for example `Messages`) to this target. It
703
+ * reuses or creates the file reference under the SDK's frameworks
704
+ * directory and makes sure the frameworks phase carries its build file.
705
+ * Linking an already linked framework is a no-op.
706
+ *
707
+ * @param name Framework name without the `.framework` suffix.
708
+ * @returns The view of the framework's file reference.
709
+ */
710
+ addSystemFramework(name: string): XcodeObject;
711
+ }
712
+ /**
713
+ * An aggregate target produces nothing itself. It exists to group other
714
+ * targets through its dependencies and to run script or copy-files
715
+ * phases, and the shared target surface covers everything it carries.
716
+ */
717
+ declare class AggregateTarget extends Target {}
718
+ /**
719
+ * A legacy target shells out to an external build tool such as make
720
+ * instead of using Xcode's build system.
721
+ */
722
+ declare class LegacyTarget extends Target<LegacyTargetProperties> {
723
+ /**
724
+ * The build tool the target invokes, as an absolute path.
725
+ */
726
+ get buildToolPath(): string | undefined;
727
+ /**
728
+ * The arguments passed to the build tool, as one shell-style string.
729
+ */
730
+ get buildArgumentsString(): string | undefined;
731
+ /**
732
+ * The working directory the build tool runs in, when the target sets
733
+ * one.
734
+ */
735
+ get buildWorkingDirectory(): string | undefined;
736
+ }
737
+ //#endregion
738
+ //#region src/model/objects.d.ts
739
+ /**
740
+ * 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.
744
+ */
745
+ declare class Group<Properties extends GroupProperties = GroupProperties> extends XcodeObject<Properties> {
746
+ /**
747
+ * Ids of the group's children, in navigator order. Non-string entries of
748
+ * a malformed document are skipped.
749
+ */
750
+ get childIds(): string[];
751
+ /**
752
+ * The views of the group's children, in navigator order.
753
+ */
754
+ children(): XcodeObject[];
755
+ /**
756
+ * Adds an existing object (a file reference or another group) to the end
757
+ * of the group's children. Adding a child the group already lists is a
758
+ * no-op.
759
+ */
760
+ addChild(child: XcodeObject): void;
761
+ /**
762
+ * Returns the descendant group for a `/`-separated path, creating any
763
+ * missing groups along the way. Each component matches a child group by
764
+ * its `path`, falling back to its `name`; created groups carry the
765
+ * component as their `path` so they mirror folders on disk.
766
+ *
767
+ * ```ts
768
+ * const generated = mainGroup.ensureGroup("Sources/Generated");
769
+ * generated.createFile("Config.swift");
770
+ * ```
771
+ */
772
+ ensureGroup(path: string): Group;
773
+ /**
774
+ * Creates a `PBXFileReference` for a path relative to this group and adds
775
+ * it to the group's children.
776
+ *
777
+ * The reference's `lastKnownFileType` derives from the file extension
778
+ * when it is a known kind; otherwise the reference carries no type and
779
+ * Xcode re-derives one on open.
780
+ *
781
+ * @param path File path relative to the group, for example
782
+ * `Demo/Config.swift`.
783
+ * @returns The view of the created file reference.
784
+ */
785
+ createFile(path: string): XcodeObject;
786
+ }
787
+ /**
788
+ * 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.
790
+ */
791
+ declare class BuildPhase extends XcodeObject<BuildPhaseProperties> {
792
+ /**
793
+ * The phase's display name, when it carries an explicit one. Xcode names
794
+ * copy-files and shell-script phases; the standard phases derive their
795
+ * names from their isa.
796
+ */
797
+ get name(): string | undefined;
798
+ /**
799
+ * Ids of the phase's `PBXBuildFile` entries, in build order.
800
+ */
801
+ get buildFileIds(): string[];
802
+ /**
803
+ * Whether the phase already lists the build file.
804
+ */
805
+ containsBuildFile(buildFileId: string): boolean;
806
+ /**
807
+ * Appends an existing build file to the phase unless it is already
808
+ * listed.
809
+ */
810
+ appendBuildFile(buildFileId: string): void;
811
+ /**
812
+ * Removes a build file from the phase. Removing an id the phase does not
813
+ * list is a no-op.
814
+ */
815
+ removeBuildFile(buildFileId: string): void;
816
+ /**
817
+ * Ensures the phase carries a `PBXBuildFile` for the referenced object,
818
+ * creating one when no existing build file in this phase points at it.
819
+ *
820
+ * @param reference The file reference or package product the build file
821
+ * should point at.
822
+ * @param options.referenceKey Which build-file field carries the
823
+ * reference: `fileRef` for file references (the default) or
824
+ * `productRef` for Swift package products.
825
+ * @param options.settings Optional per-file settings, for example
826
+ * `{ ATTRIBUTES: ["RemoveHeadersOnCopy"] }`.
827
+ * @returns The view of the phase's build file for the reference.
828
+ */
829
+ ensureBuildFile(reference: XcodeObject, options?: {
830
+ referenceKey?: "fileRef" | "productRef";
831
+ settings?: Record<string, string[] | string>;
832
+ }): XcodeObject;
833
+ }
834
+ /**
835
+ * A `PBXFileSystemSynchronizedRootGroup` is an Xcode 16 folder whose
836
+ * members are synchronized from disk instead of listed individually.
837
+ */
838
+ declare class SyncRootGroup extends XcodeObject<SyncRootGroupProperties> {
839
+ /**
840
+ * The group's on-disk folder path, when present.
841
+ */
842
+ get path(): string | undefined;
843
+ /**
844
+ * Excludes files from a target's membership in this synchronized folder
845
+ * through a `PBXFileSystemSynchronizedBuildFileExceptionSet` linked into
846
+ * the group's exceptions.
847
+ *
848
+ * Xcode keeps one exception set per target and folder, so when this
849
+ * group already carries a set for the target, the file names merge into
850
+ * it instead of creating a second set; names already excluded are not
851
+ * duplicated.
852
+ *
853
+ * The standard use is keeping a scaffolded `Info.plist` from being
854
+ * double-copied: the build already processes it through the target's
855
+ * `INFOPLIST_FILE` setting.
856
+ *
857
+ * @param target The target whose membership the exceptions restrict.
858
+ * @param membershipExceptions File names inside the folder to exclude.
859
+ * @returns The view of the target's exception set for this folder.
860
+ */
861
+ addMembershipExceptions(target: NativeTarget, membershipExceptions: string[]): XcodeObject;
862
+ }
863
+ /**
864
+ * A `PBXBuildRule` tells a target which compiler or script processes a
865
+ * kind of file.
866
+ */
867
+ declare class BuildRule extends XcodeObject<BuildRuleProperties> {
868
+ /**
869
+ * The rule's script, when it is a script rule rather than a reference
870
+ * to a compiler specification.
871
+ */
872
+ get script(): string | undefined;
873
+ }
874
+ /**
875
+ * An `XCVersionGroup` contains a versioned Core Data model
876
+ * (`.xcdatamodeld`). Its children are the model versions and
877
+ * `currentVersion` names the active one.
878
+ */
879
+ declare class VersionGroup extends Group<VersionGroupProperties> {
880
+ /**
881
+ * The view of the active model version's file reference, when the group
882
+ * names one.
883
+ */
884
+ currentVersion(): XcodeObject | undefined;
885
+ /**
886
+ * Makes a model version the active one, adding it to the group's
887
+ * children when it is not listed yet.
888
+ */
889
+ setCurrentVersion(reference: XcodeObject): void;
890
+ }
891
+ /**
892
+ * A `PBXReferenceProxy` stands in for a product built by a target of
893
+ * another project referenced from this one.
894
+ */
895
+ declare class ReferenceProxy extends XcodeObject<ReferenceProxyProperties> {
896
+ /**
897
+ * The proxy's product path inside the other project's build directory,
898
+ * when present.
899
+ */
900
+ get path(): string | undefined;
901
+ /**
902
+ * The view of the container item proxy that names the remote target,
903
+ * when the reference resolves.
904
+ */
905
+ remoteReference(): XcodeObject | undefined;
906
+ }
907
+ //#endregion
908
+ //#region src/model/project.d.ts
909
+ /**
910
+ * The `PBXProject` object at the document root. It owns the target list,
911
+ * the main group, and the project-level configurations.
912
+ */
913
+ declare class RootProject extends XcodeObject<RootProjectProperties> {
914
+ /**
915
+ * Ids of the project's targets, in project order.
916
+ */
917
+ targetIds(): string[];
918
+ /**
919
+ * The view of the project's main group, when the document has one. The
920
+ * main group is the root of Xcode's navigator tree.
921
+ */
922
+ mainGroup(): Group | undefined;
923
+ /**
924
+ * The settings dictionary of the project-level default configuration.
925
+ * Targets inherit from these settings; see
926
+ * {@link NativeTarget.getBuildSetting}.
927
+ */
928
+ defaultConfigurationSettings(): PbxprojObject | undefined;
929
+ /**
930
+ * The views of the project's Swift package references, remote and local,
931
+ * in declaration order.
932
+ */
933
+ packageReferences(): XcodeObject[];
934
+ /**
935
+ * The group product references live in, creating it (and registering it
936
+ * as the project's `productRefGroup`) when missing.
937
+ */
938
+ ensureProductsGroup(): Group;
939
+ }
940
+ /**
941
+ * Options for {@link XcodeProject.addNativeTarget}.
942
+ */
943
+ interface AddNativeTargetOptions {
944
+ /** Target name, also used as the product name. */
945
+ name: string;
946
+ /**
947
+ * Product type identifier. Must be one of the creatable kinds:
948
+ * applications, app extensions, their Messages variants, watch
949
+ * applications, App Clips, and ExtensionKit extensions.
950
+ */
951
+ productType: string;
952
+ /**
953
+ * Build settings applied to every created configuration. Each
954
+ * configuration receives its own copy.
955
+ */
956
+ buildSettings?: Record<string, number | string>;
957
+ /**
958
+ * Names of the configurations to create. Defaults to `Debug` and
959
+ * `Release`, matching the pair Xcode scaffolds.
960
+ */
961
+ configurationNames?: string[];
962
+ /**
963
+ * The configuration name recorded as the list's default. Defaults to
964
+ * `Release`.
965
+ */
966
+ defaultConfigurationName?: string;
967
+ }
968
+ /**
969
+ * A parsed `project.pbxproj` with typed, mutable access to its objects.
970
+ *
971
+ * ```ts
972
+ * const project = XcodeProject.parse(pbxprojText);
973
+ * const app = project.findMainAppTarget("ios");
974
+ * app?.setBuildSetting("MARKETING_VERSION", "1.2.0");
975
+ * const text = project.build();
976
+ * ```
977
+ */
978
+ declare class XcodeProject {
979
+ /** The parsed document this model wraps. */
980
+ readonly document: PbxprojObject;
981
+ /** The document's `objects` dictionary. */
982
+ private readonly objectsDictionary;
983
+ /**
984
+ * Identity map of object views, one view per id, created on first
985
+ * access, so views of the same object compare with `===`.
986
+ */
987
+ private readonly views;
988
+ private constructor();
989
+ /**
990
+ * Parses pbxproj text and wraps it in a model.
991
+ *
992
+ * @throws PbxprojParseError when the text is malformed.
993
+ * @throws XcodeModelError when the document has no objects dictionary.
994
+ */
995
+ static parse(text: string): XcodeProject;
996
+ /**
997
+ * Wraps an already parsed document in a model. The document is used in
998
+ * place, not copied; model mutations write into it.
999
+ */
1000
+ static fromDocument(document: PbxprojObject): XcodeProject;
1001
+ /**
1002
+ * Serializes the current document state to pbxproj text in Xcode's
1003
+ * canonical layout.
1004
+ */
1005
+ build(): string;
1006
+ /**
1007
+ * The raw properties dictionary of an object.
1008
+ *
1009
+ * @throws XcodeModelError when no object with the id exists; views use
1010
+ * this accessor, so a view of a deleted object fails loudly instead of
1011
+ * resurrecting the entry.
1012
+ */
1013
+ propertiesOf(id: string): PbxprojObject;
1014
+ /**
1015
+ * The raw properties dictionary of an object, or `undefined` when the id
1016
+ * is absent, dangling, or not a dictionary.
1017
+ */
1018
+ propertiesOfOptional(id: string | undefined): PbxprojObject | undefined;
1019
+ /**
1020
+ * The view of an object by id, or `undefined` when the id is absent or
1021
+ * its entry is not a dictionary. Repeated lookups return the same view
1022
+ * instance.
1023
+ */
1024
+ get(id: string | undefined): XcodeObject | undefined;
1025
+ /**
1026
+ * Iterates `[id, view]` over every well-formed object in the document,
1027
+ * in document order. Entries that are not dictionaries are skipped.
1028
+ */
1029
+ objects(): IterableIterator<[string, XcodeObject]>;
1030
+ /**
1031
+ * Generates a deterministic 24-character id from a seed, avoiding every
1032
+ * id the document currently contains. The id is not reserved; adding an
1033
+ * object with it (see {@link add}) is what claims it.
1034
+ */
1035
+ generateId(seed: string): string;
1036
+ /**
1037
+ * Adds an object to the document and returns its view.
1038
+ *
1039
+ * @param isa The object's kind; written as the `isa` property.
1040
+ * @param properties The object's remaining properties. The dictionary is
1041
+ * stored as passed (not copied), with `isa` written first so the
1042
+ * serialized entry leads with it.
1043
+ * @param seed Seed for the deterministic id; defaults to the isa, which
1044
+ * is only sensible for singleton objects.
1045
+ * @returns The view of the created object.
1046
+ */
1047
+ add(isa: string, properties: PbxprojObject, seed?: string): XcodeObject;
1048
+ /**
1049
+ * The view of the document's root `PBXProject` object.
1050
+ *
1051
+ * @throws XcodeModelError when `rootObject` is missing or dangling,
1052
+ * since without it no project-level operation is meaningful.
1053
+ */
1054
+ get rootProject(): RootProject;
1055
+ /**
1056
+ * The views of the project's targets of every kind (native, aggregate,
1057
+ * and legacy), in project order.
1058
+ */
1059
+ targets(): Target[];
1060
+ /**
1061
+ * The views of the project's native targets, in project order. Targets
1062
+ * of other kinds (aggregate and legacy targets) are not included.
1063
+ */
1064
+ nativeTargets(): NativeTarget[];
1065
+ /**
1066
+ * Finds a native target by name.
1067
+ */
1068
+ findTarget(name: string): NativeTarget | undefined;
1069
+ /**
1070
+ * Finds the main application target for a platform. It prefers the
1071
+ * application target whose own configurations carry the platform's
1072
+ * deployment-target key, and falls back to the first application target
1073
+ * in project order. Returns `undefined` when the project has no
1074
+ * application target.
1075
+ */
1076
+ findMainAppTarget(platform?: ApplePlatform): NativeTarget | undefined;
1077
+ /**
1078
+ * Creates a native target with its build configurations, product file
1079
+ * reference in the Products group, and the standard Sources, Frameworks,
1080
+ * and Resources build phases, and registers it on the project.
1081
+ *
1082
+ * @throws XcodeModelError for product types the model cannot create a
1083
+ * product reference for; see {@link AddNativeTargetOptions.productType}.
1084
+ */
1085
+ addNativeTarget(options: AddNativeTargetOptions): NativeTarget;
1086
+ /**
1087
+ * Finds the remote Swift package reference for a repository URL.
1088
+ */
1089
+ findSwiftPackage(repositoryUrl: string): XcodeObject | undefined;
1090
+ /**
1091
+ * Adds a remote Swift package reference and registers it on the project.
1092
+ * When the project already references the repository, the existing
1093
+ * reference is returned unchanged, requirement included; adjust an
1094
+ * existing requirement through the reference's properties. Link products
1095
+ * to targets with {@link NativeTarget.addSwiftPackageProduct}.
1096
+ *
1097
+ * @param options.repositoryURL The package's git URL.
1098
+ * @param options.requirement The version requirement dictionary as Xcode
1099
+ * stores it, for example
1100
+ * `{ kind: "upToNextMajorVersion", minimumVersion: "5.0.0" }`.
1101
+ * @returns The view of the package reference for the repository.
1102
+ */
1103
+ addSwiftPackage(options: {
1104
+ repositoryURL: string;
1105
+ requirement: Record<string, string>;
1106
+ }): XcodeObject;
1107
+ /**
1108
+ * Finds the local Swift package reference for a directory path.
1109
+ */
1110
+ findLocalSwiftPackage(relativePath: string): XcodeObject | undefined;
1111
+ /**
1112
+ * Adds a local (path-based) Swift package reference and registers it on
1113
+ * the project, returning the existing reference when the path is already
1114
+ * registered. Products link to targets the same way as remote packages,
1115
+ * through {@link NativeTarget.addSwiftPackageProduct}.
1116
+ *
1117
+ * @param relativePath The package directory, relative to the project.
1118
+ * @returns The view of the package reference for the path.
1119
+ */
1120
+ addLocalSwiftPackage(relativePath: string): XcodeObject;
1121
+ /**
1122
+ * The views of every `PBXBuildFile` that points at the referenced object
1123
+ * through `fileRef` or `productRef`. Useful for relocating a product
1124
+ * between copy phases.
1125
+ */
1126
+ buildFilesReferencing(reference: XcodeObject): XcodeObject[];
1127
+ /**
1128
+ * Validates the document's object graph and returns every problem
1129
+ * found. An empty array means the graph is structurally sound. The
1130
+ * checks cover the root object, object kinds, known references, and
1131
+ * reachability.
1132
+ */
1133
+ validate(): ProjectIssue[];
1134
+ /**
1135
+ * Removes every object unreachable from the root object and returns the
1136
+ * removed ids. Reachability is conservative. Any real reference keeps
1137
+ * an object alive, even through properties outside the known schema.
1138
+ */
1139
+ pruneOrphans(): string[];
1140
+ /**
1141
+ * The views of every object that references the id anywhere in its
1142
+ * properties. A reference is a string property naming the id, an id
1143
+ * list containing it, or a nested dictionary carrying it as a key or
1144
+ * string value.
1145
+ *
1146
+ * The scan is linear over the document; removal flows call it once per
1147
+ * removed object, which keeps teardown proportional to what is actually
1148
+ * removed.
1149
+ */
1150
+ referrersOf(id: string): XcodeObject[];
1151
+ /**
1152
+ * Removes an object from the document and strips every reference to it
1153
+ * from the remaining objects. String properties naming the id are
1154
+ * deleted, id lists drop it, and nested dictionaries keyed by object id
1155
+ * (such as `TargetAttributes`) drop its entry.
1156
+ *
1157
+ * Removing an id the document does not contain is a no-op. This is the
1158
+ * low-level removal; {@link removeTarget} composes it into a full
1159
+ * teardown.
1160
+ */
1161
+ removeObject(id: string): void;
1162
+ /**
1163
+ * Removes a target and everything that exists only for its sake. That
1164
+ * covers its build phases and their build files, its configuration list
1165
+ * and configurations, its product reference and the build files
1166
+ * embedding it, dependency objects and container proxies in both
1167
+ * directions (other targets' dependencies on it, and its own
1168
+ * dependencies on others), its membership exception sets, and
1169
+ * synchronized folders no remaining target links.
1170
+ *
1171
+ * On-disk sources are untouched; the removal is document-only, like
1172
+ * deleting a target in Xcode and keeping its folder.
1173
+ *
1174
+ * @throws XcodeModelError when the target belongs to another project,
1175
+ * since removing by another document's ids would tear down unrelated
1176
+ * objects that happen to share them.
1177
+ */
1178
+ removeTarget(target: Target): void;
1179
+ /**
1180
+ * Finds a file reference by its project-relative path, resolving each
1181
+ * reference's location through the group tree from the main group
1182
+ * (nested group `path` components join with `/`).
1183
+ *
1184
+ * Members of file-system-synchronized folders are not listed in the
1185
+ * document and therefore cannot be found; check
1186
+ * {@link NativeTarget.syncGroupPaths} for folder-level containment
1187
+ * instead.
1188
+ */
1189
+ findFileReference(projectRelativePath: string): XcodeObject | undefined;
1190
+ /**
1191
+ * Creates the typed view for an object, dispatching on its isa. Objects
1192
+ * outside the typed vocabulary get the generic base view.
1193
+ */
1194
+ private createView;
1195
+ }
1196
+ //#endregion
1197
+ //#region src/model/object.d.ts
1198
+ /**
1199
+ * A typed handle on one object of the document.
1200
+ *
1201
+ * Two lookups of the same id return the same view instance (the project
1202
+ * keeps an identity map), so views compare with `===`.
1203
+ *
1204
+ * The type parameter describes the properties of a well-formed object of
1205
+ * this kind. Subclasses fix it to their kind's interface, which gives
1206
+ * `properties` autocompletion. Treat the shape as a description rather
1207
+ * than a guarantee. A malformed document can hold anything, so the model
1208
+ * itself always reads through the narrowing accessors.
1209
+ */
1210
+ declare class XcodeObject<Properties extends PbxprojObject = PbxprojObject> {
1211
+ /** The project this object belongs to. */
1212
+ readonly project: XcodeProject;
1213
+ /** The object's 24-character identifier (its key in `objects`). */
1214
+ readonly id: string;
1215
+ /**
1216
+ * Views are created by the project's identity map; use
1217
+ * {@link XcodeProject.get} or a typed query instead of constructing
1218
+ * views directly.
1219
+ */
1220
+ constructor(project: XcodeProject, id: string);
1221
+ /**
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.
1225
+ *
1226
+ * The typed shape is asserted, not checked. It describes what a
1227
+ * well-formed object of this kind carries (see `properties.ts`).
1228
+ */
1229
+ get properties(): Properties;
1230
+ /**
1231
+ * The object's `isa` kind name, or the empty string when the field is
1232
+ * missing or malformed.
1233
+ */
1234
+ get isa(): string;
1235
+ /**
1236
+ * Reads a property expected to be a string. Returns `undefined` when the
1237
+ * property is absent or holds another type.
1238
+ */
1239
+ getString(key: string): string | undefined;
1240
+ /**
1241
+ * Writes one property of the object.
1242
+ *
1243
+ * The write goes through the untyped document dictionary. TypeScript
1244
+ * does not allow writes through a generic index, and the typed shape on
1245
+ * `properties` is descriptive anyway.
1246
+ */
1247
+ set(key: string, value: PbxprojValue): void;
1248
+ /**
1249
+ * The views of the objects referenced by an id-list property, resolved in
1250
+ * list order. Dangling ids and non-string entries of malformed documents
1251
+ * are skipped.
1252
+ */
1253
+ protected referencedViews(key: string): XcodeObject[];
1254
+ /**
1255
+ * Removes the object from the document and strips every reference to it:
1256
+ * string properties naming the id are deleted, id lists drop it, and
1257
+ * nested dictionaries keyed by object id (such as the root project's
1258
+ * `TargetAttributes`) drop its entry.
1259
+ *
1260
+ * This is the low-level removal; it does not cascade to objects that only
1261
+ * made sense alongside this one. Higher-level operations like
1262
+ * {@link XcodeProject.removeTarget} compose it into full teardowns.
1263
+ */
1264
+ removeFromProject(): void;
1265
+ }
1266
+ //#endregion
138
1267
  //#region src/parse.d.ts
139
1268
  /**
140
1269
  * Parses a `project.pbxproj` document into JavaScript values.
@@ -152,4 +1281,147 @@ declare class PbxprojBuildError extends Error {
152
1281
  */
153
1282
  declare function parsePbxproj(text: string): PbxprojValue;
154
1283
  //#endregion
155
- export { type PbxprojArray, PbxprojBuildError, type PbxprojErrorPosition, type PbxprojObject, PbxprojParseError, type PbxprojValue, buildPbxproj, parsePbxproj };
1284
+ //#region src/scheme/types.d.ts
1285
+ /**
1286
+ * The node model of a scheme document.
1287
+ *
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.
1292
+ *
1293
+ * @module
1294
+ */
1295
+ /**
1296
+ * An XML element of a scheme document.
1297
+ *
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
1301
+ * position, and adding a new key appends it.
1302
+ */
1303
+ interface XcschemeElement {
1304
+ /** Tag name, for example `Scheme` or `BuildableReference`. */
1305
+ name: string;
1306
+ /** Attribute values by name, in document order. */
1307
+ attributes: Record<string, string>;
1308
+ /** Child elements and comments, in document order. */
1309
+ children: XcschemeNode[];
1310
+ }
1311
+ /**
1312
+ * A comment inside a scheme document. Xcode never writes comments, but
1313
+ * hand-edited and tool-generated schemes can carry them, and dropping
1314
+ * them would make round-trips lossy.
1315
+ */
1316
+ interface XcschemeComment {
1317
+ /** The comment text between `<!--` and `-->`, verbatim. */
1318
+ comment: string;
1319
+ }
1320
+ /**
1321
+ * Any node a scheme element can contain.
1322
+ */
1323
+ type XcschemeNode = XcschemeElement | XcschemeComment;
1324
+ /**
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.
1328
+ */
1329
+ interface XcschemeDocument {
1330
+ /** Comments before the root element. */
1331
+ leading: XcschemeComment[];
1332
+ /** The `Scheme` element. */
1333
+ root: XcschemeElement;
1334
+ /** Comments after the root element. */
1335
+ trailing: XcschemeComment[];
1336
+ }
1337
+ /**
1338
+ * Whether a node is an element rather than a comment.
1339
+ */
1340
+ declare function isXcschemeElement(node: XcschemeNode): node is XcschemeElement;
1341
+ //#endregion
1342
+ //#region src/scheme/build.d.ts
1343
+ /**
1344
+ * Serializes a scheme document to the text of a `.xcscheme` file.
1345
+ *
1346
+ * @throws XcschemeBuildError for element or attribute names that are not
1347
+ * XML names and for attribute values carrying unencodable control
1348
+ * characters, with the path of the offending node.
1349
+ */
1350
+ declare function buildXcscheme(document: XcschemeDocument): string;
1351
+ //#endregion
1352
+ //#region src/scheme/model.d.ts
1353
+ /**
1354
+ * Collects elements of the given name anywhere in the tree, in document
1355
+ * order, the subtree root included. Passing no name collects every
1356
+ * element.
1357
+ *
1358
+ * ```ts
1359
+ * for (const reference of xcschemeElements(scheme.root, "BuildableReference")) {
1360
+ * reference.attributes["BlueprintName"] = "RenamedApp";
1361
+ * }
1362
+ * ```
1363
+ */
1364
+ declare function xcschemeElements(root: XcschemeElement, name?: string): XcschemeElement[];
1365
+ /**
1366
+ * Options for {@link createXcscheme}.
1367
+ */
1368
+ interface CreateXcschemeOptions {
1369
+ /** The application target's name, which also names the scheme. */
1370
+ appName: string;
1371
+ /**
1372
+ * The `.xcodeproj` directory name the buildable references point at.
1373
+ * Defaults to `<appName>.xcodeproj`.
1374
+ */
1375
+ xcodeprojName?: string;
1376
+ /**
1377
+ * The application target's object id in the project document. Xcode
1378
+ * repairs an empty identifier on first open, so omitting it still
1379
+ * produces a working scheme.
1380
+ */
1381
+ blueprintIdentifier?: string;
1382
+ }
1383
+ /**
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).
1388
+ */
1389
+ declare function createXcscheme(options: CreateXcschemeOptions): XcschemeDocument;
1390
+ //#endregion
1391
+ //#region src/scheme/parse.d.ts
1392
+ /**
1393
+ * Parses the text of a `.xcscheme` file into its node tree.
1394
+ *
1395
+ * @throws XcschemeParseError when the text is not a well-formed scheme
1396
+ * document, with the line and column of the failure.
1397
+ */
1398
+ declare function parseXcscheme(text: string): XcschemeDocument;
1399
+ //#endregion
1400
+ //#region src/uuid.d.ts
1401
+ /**
1402
+ * Deterministic object identifiers for generated pbxproj objects.
1403
+ *
1404
+ * Xcode identifies every object with 24 hexadecimal characters. Generated
1405
+ * ids here are deterministic: the same seed always produces the same id, so
1406
+ * programmatic edits are reproducible and diffs stay minimal across runs.
1407
+ * The format is `XX` + the first 20 characters of `md5(seed)` + `XX`, which
1408
+ * is a valid identifier that remains recognizable as generated.
1409
+ *
1410
+ * @module
1411
+ */
1412
+ /**
1413
+ * Generates a deterministic 24-character object id from a seed string.
1414
+ *
1415
+ * When the id already exists in `existing`, the seed is retried with a
1416
+ * space appended until it is free, so ids stay deterministic (the same
1417
+ * seeds in the same order produce the same ids) while never colliding
1418
+ * within a document.
1419
+ *
1420
+ * @param seed Any text that identifies the object being created, for
1421
+ * example `PBXNativeTarget DemoWidget`.
1422
+ * @param existing Ids already present in the document.
1423
+ * @returns An id not contained in `existing`; the caller records it.
1424
+ */
1425
+ declare function generateObjectId(seed: string, existing: ReadonlySet<string>): string;
1426
+ //#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 };