Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/lifecycles/BrandingExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ export interface AppTitleInRoom extends AppTitleBase {
roomId: string;
}

export interface GetFaviconParameters {
// colour parameters
bgColor: string;
textColor: string;
// font styling parameters
fontFamily: string;
fontWeight: "normal" | "italic" | "bold" | "bolder" | "lighter" | number;

// positioning parameters
isUp: boolean;
isLeft: boolean;
}

export type AppTitleContext = AppTitleBase | AppTitleInRoom;

export interface ProvideBrandingExtensions {
Expand All @@ -38,10 +51,25 @@ export interface ProvideBrandingExtensions {
* @returns A string to be used for the full title, or null to use the default title.
*/
getAppTitle(context: AppTitleContext): string | null;
/**
* Called when the app needs to generate the basic app favicon.
* @returns A string URL for the icon, or null if no new icon should be generated.
*/
getFaviconSrc(): PromiseLike<string | null>;
/**
* Called when the app needs to generate a new "badge" favicon.
* @param content The content inside the "badge".
* @param opts Extra parameters for the badge.
* @returns A string URL for the icon, or null if no new icon should be generated.
*/
getFaviconSrc(content: number | string, opts: GetFaviconParameters): PromiseLike<string | null>;
}

export abstract class BrandingExtensionsBase implements ProvideBrandingExtensions {
public getAppTitle(context: AppTitleContext): string | null {
return null;
}
public async getFaviconSrc(content?: number | string, opts?: GetFaviconParameters): Promise<string | null> {
return null;
}
}
Loading