forma-embedded-view-sdk
Version:
The Forma Embedded View SDK is a JavaScript library for creating custom extensions in Autodesk Forma (previously Spacemaker).
105 lines (104 loc) • 2.57 kB
TypeScript
import type { IframeMessenger } from "./iframe-messenger.js";
/** Project metadata */
export type Project = {
/**
* The two letter country code for the project.
*
* @example
* "no"
*/
countryCode: string;
/**
* The spatial reference identifier (SRID) for the project.
*
* @example
* 32632
*/
srid: number;
/**
* The reference point of the project in the given SRID.
*/
refPoint: [number, number];
/**
* The PROJ.4 definition of the coordinate system.
*
* @example
* "+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs"
*/
projString: string;
/**
* Timezone for the location of the project.
*
* @example
* "Europe/Oslo"
*/
timezone: string;
/**
* The hub the project is created in.
*
* @example
* "cus_abcdefgh"
*/
hubId: string;
/**
* The name of the project
* @example
* "My Forma project"
*/
name: string;
};
/**
* Access project-level metadata. See the
* [Forma documentation](https://help.autodeskforma.com/en/articles/7003747-how-to-create-a-new-project)
* for more information.
*
* @remarks
* Available via {@link auto.Forma | Forma}.{@link index.EmbeddedViewSdk.project | project}.
*/
export declare class ProjectApi {
#private;
/** @hidden */
constructor(iframeMessenger: IframeMessenger);
/**
* Fetch all project metadata.
*
* @returns The project metadata.
*
* @example
* const projectMetadata = await Forma.project.get()
*/
get(): Promise<Project>;
/**
* Fetch project country code.
*
* @hidden
* @deprecated Use countryCode from {@link get} instead.
*
* @returns Country code for the project.
*
* @example
* const countryCode = await Forma.project.getCountryCode()
*/
getCountryCode(): Promise<string | undefined>;
/**
* Fetch project location (latitude and longitude).
*
* @returns Geolocation for the project as [latitude, longitude].
*
* @example
* const [latitude, longitude] = await Forma.project.getGeoLocation()
*/
getGeoLocation(): Promise<[number, number] | undefined>;
/**
* Fetch project timezone.
*
* @hidden
* @deprecated Use timezone from {@link get} instead.
*
* @returns Timezone for the project.
*
* @example
* const timezone = await Forma.project.getTimezone()
*/
getTimezone(): Promise<string | undefined>;
}