studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
109 lines (108 loc) • 3.52 kB
TypeScript
/** biome-ignore-all lint/style/noNonNullAssertion: This file is using non-null assertions */
/** biome-ignore-all lint/suspicious/noExplicitAny: This file is using explicit any types */
declare const configElement: HTMLElement | null;
declare const loginPageBackground: string | undefined;
declare const loginPageCustomImage: string | undefined;
declare const currentMode: string;
declare const studioCMS3DModel = "https://cdn.studiocms.dev/studiocms-logo.glb";
/**
* A valid image that can be used as a background for the StudioCMS Logo.
*/
interface ValidImage {
readonly name: string;
readonly label: string;
readonly format: 'local' | 'web';
readonly light: {
src: string;
} | null;
readonly dark: {
src: string;
} | null;
}
/**
* The parameters for the background image.
*/
type BackgroundParams = {
background: string;
customImageHref: string;
mode: 'light' | 'dark';
};
/**
* Parses the background image config.
* @param imageName The name of the image to parse.
*/
declare function parseBackgroundImageConfig(imageName?: string | undefined): string;
declare function parseToString(value: string | undefined | null): string;
/**
* The parameters for the background image config.
*/
declare const backgroundConfig: BackgroundParams;
/**
* Gets the background config based on the parameters.
*/
declare function getBackgroundConfig(config: BackgroundParams, validImages: ValidImage[]): ValidImage;
/**
* Selects the background based on the image.
*/
declare function bgSelector(image: ValidImage, params: BackgroundParams): string | undefined;
/**
* Lazy-loading wrapper for the StudioCMS 3D Logo
*/
declare class LazyStudioCMS3DLogo {
private container;
private observer;
private loaded;
private logoInstance;
private destroyed;
constructor(containerEl: HTMLDivElement);
private loadThreeJS;
private showLoadingState;
private showErrorState;
destroy(): void;
}
/**
* Enhanced StudioCMS3DLogo that accepts modules as dependency injection
*/
declare class StudioCMS3DLogo {
canvasContainer: HTMLDivElement;
scene: any;
camera: any;
renderer: any;
model: any | undefined;
mouseX: number;
mouseY: number;
composer: any;
outlinePass: any | undefined;
outlinedObjects: any[];
defaultComputedCameraZ: number | undefined;
BackgroundMesh: any | undefined;
frustumHeight: number | undefined;
frames: number;
fps: number;
lastTime: number;
lastFrameTimes: number[];
MAX_FRAME_TIMES_LENGTH: number;
private resizeHandler?;
private mouseMoveHandler?;
private prevLoadingOnLoad?;
private bgAspect?;
private loadingManager?;
private glassMaterial;
private modules;
constructor(containerEl: HTMLDivElement, outlineColor: any, reducedMotion: boolean, image: ValidImage, modules: any);
updateFPS: () => void;
animate: () => void;
private getGlassMaterial;
loadLogoModel: () => Promise<void>;
addPostProcessing: (outlines: boolean, outlineColor: any) => void;
addOutlines: (outlineColor: any) => void;
addBackgroundImage: (image: ValidImage) => Promise<void>;
initListeners: (reducedMotion: boolean) => void;
initResizeListener: () => void;
initMouseMoveListener: () => void;
dispose: () => void;
registerLoadingCallback: () => void;
recomputeGlassMaterial: () => void;
}
declare const logoContainer: HTMLDivElement | null;
declare const smallScreen: boolean;