Animation
What a builder returns: give it to a prop, a transition or a motion value.
Utilização
Overlay a now-playing caption
Este tipo é usado por Blur
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
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
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
targetsó de leitura | T | readonly number[] | Não | Where it comes to rest; without one, the prop or transition says. |
onEndsó de leitura | AnimationCallback | Não | — |
to | <U extends number | string>(target: U | readonly number[]) => Animation<U extends number ? number : string> | Sim | The 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
(finished: boolean): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
finished | boolean | Sim | — |
Devolve
void
to — assinaturas de método
Assinaturas
<U extends number | string>(target: U | readonly number[]): Animation<U extends number ? number : string>Parâmetros de tipo
| Nome | Restrição | Predefinição |
|---|---|---|
U | string | number | — |
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
target | readonly number[] | U | Sim | — |
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.