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