refactor: ded

This commit is contained in:
cha0s 2022-03-15 10:20:39 -05:00
parent 196997d0a8
commit 9ea752e858
5 changed files with 2 additions and 65 deletions

View File

@ -1,13 +0,0 @@
import {JsonResource} from '@avocado/resource';
export default class BaseAnimation extends JsonResource {
static children() {
return {
frameRate: {
type: 'number',
},
};
}
}

View File

@ -1,8 +1,5 @@
import {Flecks, Hooks} from '@flecks/core';
import types from './types';
import typesDecorator from './types-decorator';
export {
cancelAnimationFrame,
clearAnimation,
@ -18,8 +15,6 @@ export {default as Transition, TransitionResult} from './transition';
export default {
[Hooks]: {
'@avocado/behavior.types': types,
'@avocado/behavior.types.decorate': typesDecorator,
'@avocado/resource.resources': Flecks.provide(require.context('./resources', false, /\.js$/)),
'@avocado/resource.resources.decorate': (
Flecks.decorate(require.context('./resources/decorators', false, /\.js$/))

View File

@ -1,8 +1,8 @@
import {Property} from '@avocado/core';
import {Rectangle, Vector} from '@avocado/math';
import {JsonResource} from '@avocado/resource';
import {compose, EventEmitter} from '@flecks/core';
import BaseAnimation from '../base-animation';
import TimedIndex from '../timed-index';
const decorate = compose(
@ -20,7 +20,7 @@ const decorate = compose(
}),
);
export default () => class Animation extends decorate(BaseAnimation) {
export default () => class Animation extends decorate(JsonResource) {
constructor() {
super();

View File

@ -1,37 +0,0 @@
export default (types) => ({
...types,
entity: {
...types.entity,
children: (entity) => ({
...types.entity.children(entity),
lfo: {
args: [
{
label: 'Properties',
type: 'object',
},
{
label: 'Duration',
type: 'number',
},
],
label: 'Oscillates properties.',
type: 'void',
},
transition: {
args: [
{
label: 'Properties',
type: 'object',
},
{
label: 'Duration',
type: 'number',
},
],
label: 'Transitions properties for $2 seconds.',
type: 'void',
},
}),
},
});

View File

@ -1,8 +0,0 @@
import BaseAnimation from './base-animation';
export default () => ({
animation: {
children: BaseAnimation.children,
infer: (v) => v?.constructor?.children === BaseAnimation.children,
},
});