animation

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 5 Imported by: 6

Documentation

Overview

Package animation implements the Animation domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the Animation domain with the connection set to conn.

Types

type Animation

type Animation struct {
	ID           string  `json:"id"`           // `Animation`'s id.
	Name         string  `json:"name"`         // `Animation`'s name.
	PausedState  bool    `json:"pausedState"`  // `Animation`'s internal paused state.
	PlayState    string  `json:"playState"`    // `Animation`'s play state.
	PlaybackRate float64 `json:"playbackRate"` // `Animation`'s playback rate.
	StartTime    float64 `json:"startTime"`    // `Animation`'s start time.
	CurrentTime  float64 `json:"currentTime"`  // `Animation`'s current time.
	// Type Animation type of `Animation`.
	//
	// Values: "CSSTransition", "CSSAnimation", "WebAnimation".
	Type   string  `json:"type"`
	Source *Effect `json:"source,omitempty"` // `Animation`'s source animation node.
	CSSID  *string `json:"cssId,omitempty"`  // A unique ID for `Animation` representing the sources that triggered this CSS animation/transition.
}

Animation Animation instance.

type CanceledClient

type CanceledClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*CanceledReply, error)
	rpcc.Stream
}

CanceledClient is a client for AnimationCanceled events. Event for when an animation has been canceled.

type CanceledReply

type CanceledReply struct {
	ID string `json:"id"` // Id of the animation that was canceled.
}

CanceledReply is the reply for AnimationCanceled events.

type CreatedClient

type CreatedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*CreatedReply, error)
	rpcc.Stream
}

CreatedClient is a client for AnimationCreated events. Event for each animation that has been created.

type CreatedReply

type CreatedReply struct {
	ID string `json:"id"` // Id of the animation that was created.
}

CreatedReply is the reply for AnimationCreated events.

type Effect

type Effect struct {
	Delay          float64            `json:"delay"`                   // `AnimationEffect`'s delay.
	EndDelay       float64            `json:"endDelay"`                // `AnimationEffect`'s end delay.
	IterationStart float64            `json:"iterationStart"`          // `AnimationEffect`'s iteration start.
	Iterations     float64            `json:"iterations"`              // `AnimationEffect`'s iterations.
	Duration       float64            `json:"duration"`                // `AnimationEffect`'s iteration duration.
	Direction      string             `json:"direction"`               // `AnimationEffect`'s playback direction.
	Fill           string             `json:"fill"`                    // `AnimationEffect`'s fill mode.
	BackendNodeID  *dom.BackendNodeID `json:"backendNodeId,omitempty"` // `AnimationEffect`'s target node.
	KeyframesRule  *KeyframesRule     `json:"keyframesRule,omitempty"` // `AnimationEffect`'s keyframes.
	Easing         string             `json:"easing"`                  // `AnimationEffect`'s timing function.
}

Effect AnimationEffect instance

type GetCurrentTimeArgs

type GetCurrentTimeArgs struct {
	ID string `json:"id"` // Id of animation.
}

GetCurrentTimeArgs represents the arguments for GetCurrentTime in the Animation domain.

func NewGetCurrentTimeArgs

func NewGetCurrentTimeArgs(id string) *GetCurrentTimeArgs

NewGetCurrentTimeArgs initializes GetCurrentTimeArgs with the required arguments.

type GetCurrentTimeReply

type GetCurrentTimeReply struct {
	CurrentTime float64 `json:"currentTime"` // Current time of the page.
}

GetCurrentTimeReply represents the return values for GetCurrentTime in the Animation domain.

type GetPlaybackRateReply

type GetPlaybackRateReply struct {
	PlaybackRate float64 `json:"playbackRate"` // Playback rate for animations on page.
}

GetPlaybackRateReply represents the return values for GetPlaybackRate in the Animation domain.

type KeyframeStyle

type KeyframeStyle struct {
	Offset string `json:"offset"` // Keyframe's time offset.
	Easing string `json:"easing"` // `AnimationEffect`'s timing function.
}

KeyframeStyle Keyframe Style

type KeyframesRule

type KeyframesRule struct {
	Name      *string         `json:"name,omitempty"` // CSS keyframed animation's name.
	Keyframes []KeyframeStyle `json:"keyframes"`      // List of animation keyframes.
}

KeyframesRule Keyframes Rule

type ReleaseAnimationsArgs

type ReleaseAnimationsArgs struct {
	Animations []string `json:"animations"` // List of animation ids to seek.
}

ReleaseAnimationsArgs represents the arguments for ReleaseAnimations in the Animation domain.

func NewReleaseAnimationsArgs

func NewReleaseAnimationsArgs(animations []string) *ReleaseAnimationsArgs

NewReleaseAnimationsArgs initializes ReleaseAnimationsArgs with the required arguments.

type ResolveAnimationArgs

type ResolveAnimationArgs struct {
	AnimationID string `json:"animationId"` // Animation id.
}

ResolveAnimationArgs represents the arguments for ResolveAnimation in the Animation domain.

func NewResolveAnimationArgs

func NewResolveAnimationArgs(animationID string) *ResolveAnimationArgs

NewResolveAnimationArgs initializes ResolveAnimationArgs with the required arguments.

type ResolveAnimationReply

type ResolveAnimationReply struct {
	RemoteObject runtime.RemoteObject `json:"remoteObject"` // Corresponding remote object.
}

ResolveAnimationReply represents the return values for ResolveAnimation in the Animation domain.

type SeekAnimationsArgs

type SeekAnimationsArgs struct {
	Animations  []string `json:"animations"`  // List of animation ids to seek.
	CurrentTime float64  `json:"currentTime"` // Set the current time of each animation.
}

SeekAnimationsArgs represents the arguments for SeekAnimations in the Animation domain.

func NewSeekAnimationsArgs

func NewSeekAnimationsArgs(animations []string, currentTime float64) *SeekAnimationsArgs

NewSeekAnimationsArgs initializes SeekAnimationsArgs with the required arguments.

type SetPausedArgs

type SetPausedArgs struct {
	Animations []string `json:"animations"` // Animations to set the pause state of.
	Paused     bool     `json:"paused"`     // Paused state to set to.
}

SetPausedArgs represents the arguments for SetPaused in the Animation domain.

func NewSetPausedArgs

func NewSetPausedArgs(animations []string, paused bool) *SetPausedArgs

NewSetPausedArgs initializes SetPausedArgs with the required arguments.

type SetPlaybackRateArgs

type SetPlaybackRateArgs struct {
	PlaybackRate float64 `json:"playbackRate"` // Playback rate for animations on page
}

SetPlaybackRateArgs represents the arguments for SetPlaybackRate in the Animation domain.

func NewSetPlaybackRateArgs

func NewSetPlaybackRateArgs(playbackRate float64) *SetPlaybackRateArgs

NewSetPlaybackRateArgs initializes SetPlaybackRateArgs with the required arguments.

type SetTimingArgs

type SetTimingArgs struct {
	AnimationID string  `json:"animationId"` // Animation id.
	Duration    float64 `json:"duration"`    // Duration of the animation.
	Delay       float64 `json:"delay"`       // Delay of the animation.
}

SetTimingArgs represents the arguments for SetTiming in the Animation domain.

func NewSetTimingArgs

func NewSetTimingArgs(animationID string, duration float64, delay float64) *SetTimingArgs

NewSetTimingArgs initializes SetTimingArgs with the required arguments.

type StartedClient

type StartedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*StartedReply, error)
	rpcc.Stream
}

StartedClient is a client for AnimationStarted events. Event for animation that has been started.

type StartedReply

type StartedReply struct {
	Animation Animation `json:"animation"` // Animation that was started.
}

StartedReply is the reply for AnimationStarted events.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL