scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
37 lines (29 loc) • 584 B
text/typescript
import {AbsSize} from 'scriptable-abstract';
interface SizeMockState {
width: number;
height: number;
}
const _DEFAULT_STATE: SizeMockState = {
width: 0,
height: 0,
};
export class MockSize extends AbsSize<SizeMockState> {
constructor(width = 0, height = 0) {
super({
width,
height,
});
}
get width(): number {
return this.state.width;
}
set width(value: number) {
this.setState({width: value});
}
get height(): number {
return this.state.height;
}
set height(value: number) {
this.setState({height: value});
}
}