Mobile Locker JavaScript SDK
    Preparing search index...

    Type Alias WithStatusBooleans<T>

    WithStatusBooleans: T & {
        readonly [K in T["status"] as `is${Capitalize<SnakeToCamel<K>>}`]: boolean
    }

    Intersects a type that has a status string field with boolean helpers of the form is{Status} for every status value in the union.

    Snake_case status values are converted to camelCase: 'not_connected'isNotConnected

    Type Parameters

    • T extends { status: string }
    type MyResult = WithStatusBooleans<
    | { status: 'success'; data: string }
    | { status: 'not_found' }
    >
    // Result has: isSuccess, isNotFound