import { CSSResult, CSSResultArray } from "lit-element"; export * from "../types.js"; import { User, Question, CardClues, MetalUser, AuthTokens, AccessToken, MetalGenerics, MetalSettings, ScheduleEvent, QuestionDraft, TokenStoreTopic, UserUmbrellaTopic, ScheduleSentryTopic, QuestionQuarryTopic, LiveshowLizardTopic, SettingsSheriffTopic, PremiumPachydermTopic } from "../types.js"; import { AuthModel } from "./models/auth-model.js"; import { PaywallModel } from "./models/paywall-model.js"; import { PersonalModel } from "./models/personal-model.js"; import { ScheduleModel } from "./models/schedule-model.js"; import { QuestionsModel } from "./models/questions-model.js"; import { LiveshowViewModel, LiveshowModel } from "./models/liveshow-model.js"; import * as loading from "./toolbox/loading.js"; import { Logger } from "../toolbox/logger/interfaces.js"; export interface Personal { user: MetalUser; settings: MetalSettings; } export interface MetalConfig { ["core-server"]: string; ["liveshow-server"]: string; ["paywall-server"]: string; ["questions-server"]: string; ["schedule-server"]: string; ["settings-server"]: string; } export declare type CSS = CSSResult | CSSResultArray; export declare type ConstructorFor = new (...args: any[]) => T; export interface MetalOptions { logger: Logger; tokenStore: TokenStoreTopic; liveshowLizard: LiveshowLizardTopic; scheduleSentry: ScheduleSentryTopic; questionQuarry: QuestionQuarryTopic; premiumPachyderm: PremiumPachydermTopic; userUmbrella: UserUmbrellaTopic; settingsSheriff: SettingsSheriffTopic; checkoutPopupUrl: string; decodeAccessToken: DecodeAccessToken; triggerAccountPopup: TriggerAccountPopup; triggerCheckoutPopup: TriggerCheckoutPopup; } export interface AuthContext { user: U; exp: number; accessToken: AccessToken; } export declare type GetAuthContext = () => Promise>; export declare type DecodeAccessToken = (accessToken: AccessToken) => AuthContext; export declare type TriggerAccountPopup = () => Promise; export declare type TriggerCheckoutPopup = (o: { stripeSessionId: string; }) => Promise; export interface LoginWithAccessToken { (accessToken: AccessToken): Promise; } export interface AuthPayload { user: U; getAuthContext: GetAuthContext; } export interface PremiumInfo { cardClues: CardClues; } export interface QuestionValidation { angry: boolean; message: string; postable: boolean; } export interface QuestionQuarryUi { fetchQuestions(o: { board: string; }): Promise; postQuestion(o: { draft: QuestionDraft; }): Promise; archiveQuestion(o: { questionId: string; }): Promise; likeQuestion(o: { like: boolean; questionId: string; }): Promise; archiveBoard(o: { board: string; }): Promise; } export interface MockQuestion { tagline: string; content: string; likes: number; ban?: { days: number; reason: string; }; } export interface VideoPayload { vimeoId: string; } export declare type PrepareHandleLikeClick = (o: { like: boolean; questionId: string; }) => (event: MouseEvent) => void; export interface Supermodel { auth: AuthModel; paywall: PaywallModel; personal: PersonalModel; liveshow: LiveshowModel; schedule: ScheduleModel; questions: QuestionsModel; } export declare enum ProfileMode { Error = 0, Loading = 1, Loaded = 2, None = 3 } export declare enum BillingPremiumSubscription { Unsubscribed = 0, Subscribed = 1 } export declare enum PremiumStatus { NotPremium = 0, Premium = 1 } export declare enum PrivilegeLevel { Unknown = 0, Unprivileged = 1, Privileged = 2 } export interface SettingsPremiumSubscription { card: CardClues; } export interface AccountShare { login: () => Promise; logout: () => Promise; authLoad: loading.Load>; } export interface MyAvatarShare { personalLoad: loading.Load; } export interface ButtonPremiumShare { personalLoad: loading.Load; premium: boolean; premiumUntil: number; premiumInfoLoad: loading.Load; login(): Promise; checkoutPremium(): Promise; } export interface AdminModeShare { personalLoad: loading.Load; setAdminMode(adminMode: boolean): Promise; } export interface AdminOnlyShare { personalLoad: loading.Load; } export interface PersonalShare { personal: Personal; personalLoad: loading.Load; saveProfile(profile: Personal["user"]["profile"]): Promise; setAdminMode(adminMode: boolean): Promise; } export interface PaywallShare { personalLoad: loading.Load; premium: boolean; premiumUntil: number; premiumInfoLoad: loading.Load; checkoutPremium(): Promise; updatePremium(): Promise; cancelPremium(): Promise; } export interface QuestionsShare { user: MetalUser; uiBureau: QuestionQuarryUi; fetchCachedQuestions(board: string): Question[]; } export interface CountdownShare { events: ScheduleEvent[]; authLoad: loading.Load>; loadEvent: (label: string) => Promise; saveEvent: (event: ScheduleEvent) => Promise; } export interface LiveshowShare { authLoad: loading.Load>; makeViewModel(options: { label: string; }): { dispose: () => void; viewModel: LiveshowViewModel; }; }