Constructors

Properties

injectName: any
messaging: DuckplayerPage
notify: <
    Method extends
        | "openInfo"
        | "openSettings"
        | "reportInitException"
        | "reportPageException"
        | "telemetryEvent",
    Msg = | Extract<OpenInfoNotification, { method: Method }>
    | Extract<OpenSettingsNotification, { method: Method }>
    | Extract<ReportInitExceptionNotification, { method: Method }>
    | Extract<ReportPageExceptionNotification, { method: Method }>
    | Extract<TelemetryEventNotification, { method: Method }>,
>(
    ...args: Msg extends { params: Params } ? [Method, Params] : [Method],
) => void
request: <
    Method extends "initialSetup"
    | "setUserValues"
    | "getUserValues",
    Msg =
        | Extract<GetUserValuesRequest, { method: Method }>
        | Extract<InitialSetupRequest, { method: Method }>
        | Extract<SetUserValuesRequest, { method: Method }>,
    Return = Msg extends { result: Result } ? Result : void,
>(
    ...args: Msg extends { params: Params } ? [Method, Params] : [Method],
) => Promise<Return>
subscribe: <
    Method extends "onUserValuesChanged",
    Msg = Extract<
        OnUserValuesChangedSubscription,
        { subscriptionEvent: Method },
    >,
    Callback = Msg extends { params: Params }
        ? (params: Params) => void
        : (a: never) => void,
>(
    subscriptionEvent: Method,
    cb: Callback,
) => () => void

Methods

  • This is a subscription that we set up when the page loads. We use this value to show/hide the checkboxes.

    Integration NOTE: Native platforms should always send this at least once on initial page load.

    // the payload that we receive should look like this
    {
    "context": "specialPages",
    "featureName": "duckPlayerPage",
    "subscriptionName": "onUserValuesChanged",
    "params": {
    "overlayInteracted": false,
    "privatePlayerMode": {
    "enabled": {}
    }
    }
    }

    Parameters

    Returns () => void

  • This will be sent if the application has loaded, but a client-side error has occurred that cannot be recovered from

    Parameters

    • params: { message: string }

    Returns void