Skip to content

Commit

Permalink
Merge pull request #467 from KaiVolland/unsupported-properties-function
Browse files Browse the repository at this point in the history
Adds Function to unsupportedProperties
  • Loading branch information
KaiVolland authored Sep 5, 2022
2 parents c30ab88 + 20e0639 commit 18ca2ba
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
7 changes: 7 additions & 0 deletions examples/parsersample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export class SampleParser implements StyleParser {
info: 'Blur is only partially supported'
}
}
},
Function: {
acos: 'none',
strAbbreviate: {
support: 'partial',
info: 'Better use strSubstring instead.'
}
}
};

Expand Down
6 changes: 3 additions & 3 deletions functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ export interface Fatan2 extends FunctionCall<number> {
export interface Fbetween extends FunctionCall<boolean> {
name: 'between';
args: [
Expression<string>,
Expression<string>,
Expression<string>
Expression<number>,
Expression<number>,
Expression<number>
];
};

Expand Down
11 changes: 8 additions & 3 deletions style.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
GeoStylerBooleanFunction,
GeoStylerFunction,
GeoStylerNumberFunction,
GeoStylerStringFunction
} from './functions';
Expand Down Expand Up @@ -80,12 +81,13 @@ export type RangeFilter = [
];

/**
* A ComparisonFilter compares a value of an object (by key) with an expected
* value.
* A ComparisonFilter compares two values.
* If the fist argument is a GeoStylerFunction it will be evaluated it.
* If it is a string it will be treated as key of an object.
*/
export type ComparisonFilter = [
ComparisonOperator,
Expression<string>,
Expression<string | number | boolean>,
Expression<string | number | boolean>
] | RangeFilter;

Expand Down Expand Up @@ -733,6 +735,9 @@ export interface UnsupportedProperties {
[key in keyof Required<RasterSymbolizer>]?: SupportDef
};
};
Function?: SupportDef | {
[key in GeoStylerFunction['name']]?: SupportDef;
};
}

/**
Expand Down

0 comments on commit 18ca2ba

Please sign in to comment.