@bacons/xcode
Version:
pbxproj parser
93 lines • 4.92 kB
TypeScript
import * as json from "../json/types";
import { AbstractObject } from "./AbstractObject";
import type { ValueOf } from "./utils/util.types";
import type { PBXGroup } from "./AbstractGroup";
import type { PBXAggregateTarget } from "./PBXAggregateTarget";
import type { PBXBuildFile } from "./PBXBuildFile";
import type { PBXBuildRule } from "./PBXBuildRule";
import type { PBXContainerItemProxy } from "./PBXContainerItemProxy";
import type { PBXFileReference } from "./PBXFileReference";
import type { PBXLegacyTarget } from "./PBXLegacyTarget";
import type { PBXNativeTarget } from "./PBXNativeTarget";
import type { PBXProject } from "./PBXProject";
import type { PBXReferenceProxy } from "./PBXReferenceProxy";
import type { PBXAppleScriptBuildPhase, PBXCopyFilesBuildPhase, PBXFrameworksBuildPhase, PBXHeadersBuildPhase, PBXResourcesBuildPhase, PBXRezBuildPhase, PBXShellScriptBuildPhase, PBXSourcesBuildPhase } from "./PBXSourcesBuildPhase";
import type { PBXTargetDependency } from "./PBXTargetDependency";
import type { PBXVariantGroup } from "./PBXVariantGroup";
import type { XCBuildConfiguration } from "./XCBuildConfiguration";
import type { XCConfigurationList } from "./XCConfigurationList";
import type { XCVersionGroup } from "./XCVersionGroup";
import type { PBXFileSystemSynchronizedRootGroup } from "./PBXFileSystemSynchronizedRootGroup";
import type { PBXFileSystemSynchronizedBuildFileExceptionSet } from "./PBXFileSystemSynchronizedBuildFileExceptionSet";
import type { PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet } from "./PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet";
declare type IsaMapping = {
[]: PBXBuildFile;
[]: PBXAppleScriptBuildPhase;
[]: PBXCopyFilesBuildPhase;
[]: PBXFrameworksBuildPhase;
[]: PBXHeadersBuildPhase;
[]: PBXResourcesBuildPhase;
[]: PBXShellScriptBuildPhase;
[]: PBXSourcesBuildPhase;
[]: PBXContainerItemProxy;
[]: PBXFileReference;
[]: PBXGroup;
[]: PBXVariantGroup;
[]: XCVersionGroup;
[]: PBXFileSystemSynchronizedRootGroup;
[]: PBXFileSystemSynchronizedBuildFileExceptionSet;
[]: PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet;
[]: PBXNativeTarget;
[]: PBXAggregateTarget;
[]: PBXLegacyTarget;
[]: PBXProject;
[]: PBXTargetDependency;
[]: XCBuildConfiguration;
[]: XCConfigurationList;
[]: PBXBuildRule;
[]: PBXReferenceProxy;
[]: PBXRezBuildPhase;
};
declare type AnyModel = ValueOf<IsaMapping>;
export declare class XcodeProject extends Map<json.UUID, AnyModel> {
filePath: string;
/**
* Versioning system for the entire archive.
* @example `1`
*/
archiveVersion: number;
/**
* Versioning system for the `objects` dictionary.
* @example `55`
*/
objectVersion: number;
/** UUID for the initial object in the `objects` dictionary. */
rootObject: PBXProject;
/** No idea what this does, I've Googled it a bit. */
classes: Record<json.UUID, unknown>;
/** JSON objects which haven't been inflated yet */
private internalJsonObjects;
/**
* @param filePath -- path to a `pbxproj` file.
* @returns a new instance of `XcodeProject`
*/
static open(filePath: string): XcodeProject;
constructor(filePath: string, props: Partial<json.XcodeProject>);
/** The directory containing the `*.xcodeproj/project.pbxproj` file, e.g. `/ios/` in React Native. */
getProjectRoot(): string;
getObject(uuid: string): any;
private _getObjectOptional;
createObject<TKlass extends json.AbstractObject<any>, TInstance = InstanceType<IsaMapping[TKlass["isa"]]>>(uuid: string, obj: TKlass): TInstance;
private ensureAllObjectsInflated;
createModel<TProps extends json.AbstractObject<any>>(opts: TProps): InstanceType<IsaMapping[TProps["isa"]]>;
getReferenceForPath(absolutePath: string): PBXFileReference | null;
getReferrers(uuid: string): AbstractObject[];
private isUniqueId;
private getUniqueId;
toJSON(): json.XcodeProject;
}
export {};
//# sourceMappingURL=XcodeProject.d.ts.map