MCPcopy
hub / github.com/midrender/revideo / tweener

Method tweener

packages/2d/src/lib/code/CodeSignal.ts:99–123  ·  view source on GitHub ↗
(
    value: SignalValue<PossibleCodeScope>,
    duration: number,
    timingFunction: TimingFunction,
  )

Source from the content-addressed store, hash-verified

97 }
98
99 public override *tweener(
100 value: SignalValue<PossibleCodeScope>,
101 duration: number,
102 timingFunction: TimingFunction,
103 ): ThreadGenerator {
104 let tokenize = defaultTokenize;
105 const highlighter = unwrap(this.highlighter);
106 if (highlighter) {
107 yield (async () => {
108 do {
109 await DependencyContext.consumePromises();
110 highlighter.initialize();
111 } while (DependencyContext.hasPromises());
112 })();
113 tokenize = (input: string) => highlighter.tokenize(input);
114 }
115
116 this.progress(0);
117 this.set({
118 progress: this.progress,
119 fragments: defaultDiffer(this.get(), this.parse(unwrap(value)), tokenize),
120 });
121 yield* this.progress(1, duration, timingFunction);
122 this.set(value);
123 }
124
125 public edit(duration: number = 0.6): TagGenerator {
126 return (strings, ...tags) =>

Callers

nothing calls this directly

Calls 10

parseMethod · 0.95
unwrapFunction · 0.90
defaultDifferFunction · 0.90
consumePromisesMethod · 0.80
hasPromisesMethod · 0.80
progressMethod · 0.80
initializeMethod · 0.65
tokenizeMethod · 0.65
setMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected