Add abstract getter for default parameters.
This commit is contained in:
parent
6e1c684ba4
commit
243e53c413
|
@ -1,4 +1,6 @@
|
|||
export abstract class BaseOperation<P> {
|
||||
public abstract get default(): P;
|
||||
|
||||
public parameters: P;
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,6 +17,10 @@ export class Crop extends BaseOperation<CropParameters> {
|
|||
y: 0,
|
||||
};
|
||||
|
||||
public get default() {
|
||||
return Crop.default;
|
||||
}
|
||||
|
||||
public appendCrop = false;
|
||||
public name = 'gegl:crop';
|
||||
|
||||
|
|
|
@ -3,6 +3,10 @@ import {BaseOperation} from './base.js';
|
|||
export type GenericParameters = Record<string, number | string>;
|
||||
|
||||
export class Generic extends BaseOperation<GenericParameters> {
|
||||
public get default() {
|
||||
return {};
|
||||
}
|
||||
|
||||
public appendCrop: boolean;
|
||||
public name: string;
|
||||
|
||||
|
|
|
@ -33,6 +33,10 @@ export class Mirrors extends BaseOperation<MirrorsParameters> {
|
|||
warp: true,
|
||||
};
|
||||
|
||||
public get default() {
|
||||
return Mirrors.default;
|
||||
}
|
||||
|
||||
public appendCrop = false;
|
||||
public name = 'gegl:mirrors';
|
||||
|
||||
|
|
|
@ -45,6 +45,10 @@ export class Newsprint extends BaseOperation<NewsprintParameters> {
|
|||
turbulence: 0,
|
||||
};
|
||||
|
||||
public get default() {
|
||||
return Newsprint.default;
|
||||
}
|
||||
|
||||
public appendCrop = false;
|
||||
public name = 'gegl:newsprint';
|
||||
|
||||
|
|
|
@ -13,6 +13,10 @@ export class SimplexNoise extends BaseOperation<SimplexNoiseParameters> {
|
|||
seed: 1,
|
||||
};
|
||||
|
||||
public get default() {
|
||||
return SimplexNoise.default;
|
||||
}
|
||||
|
||||
public appendCrop = true;
|
||||
public name = 'gegl:simplex-noise';
|
||||
|
||||
|
|
Loading…
Reference in New Issue