Utilização

Overlay a now-playing caption

Este tipo é usado por Blur

tsx
import { Blur, Image, Text, VStack } from 'kuito';

export default function NowPlaying() {
  return (
    <VStack flex={1}>
      <Image
        src="https://example.com/cover.jpg"
        position="absolute"
        top={0}
        left={0}
        right={0}
        bottom={0}
      />
      <Blur material="thin" position="absolute" bottom={0} left={0} right={0} padding={16}>
        <Text>Now playing</Text>
      </Blur>
    </VStack>
  );
}

Declaração do tipo

ts
export interface Animation<T = number> {
  /** Where it comes to rest; without one, the prop or transition says. */
  readonly target?: T | readonly number[];
  readonly __kuitoAnimation: AnimationSpec;
  readonly onEnd?: AnimationCallback;
  /**
   * The same animation toward `target`. Several numbers are snap points: a
   * release goes to the one nearest where the throw would land.
   */
  to<U extends number | string>(
    target: U | readonly number[],
  ): Animation<U extends number ? number : string>;
}

Membros 3

NomeTipoObrigatórioDescrição
targetsó de leituraT | readonly number[]NãoWhere it comes to rest; without one, the prop or transition says.
onEndsó de leituraAnimationCallbackNão—
to<U extends number | string>(target: U | readonly number[]) => Animation<U extends number ? number : string>SimThe same animation toward target. Several numbers are snap points: a release goes to the one nearest where the throw would land.
onEnd — assinaturas de método

Assinaturas

ts
(finished: boolean): void

Parâmetros

NomeTipoObrigatórioDescrição
finishedbooleanSim—

Devolve

void

to — assinaturas de método

Assinaturas

ts
<U extends number | string>(target: U | readonly number[]): Animation<U extends number ? number : string>

Parâmetros de tipo

NomeRestriçãoPredefinição
Ustring | number—

Parâmetros

NomeTipoObrigatórioDescrição
targetreadonly number[] | USim—

Devolve

Animation<U extends number ? number : string>

Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.