@samatawy/rules-world 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,56 @@
1
+ import { FunctionExpression, Expression, TypedParameter, TypeChecker, AtomicType, ArrayType, ObjectType, ObjectArrayType, ValidationResult, WorkingContext } from '@samatawy/rules';
2
+
3
+ type CountryData = {
4
+ name: string;
5
+ officialName: string;
6
+ alias: string[];
7
+ twoLetterCode: string;
8
+ threeLetterCode: string;
9
+ callingCodes: string[];
10
+ topLevelDomains: string[];
11
+ languages: string[];
12
+ capital: string;
13
+ currency: string;
14
+ currencyName: string;
15
+ currencySymbol: string;
16
+ continent: string;
17
+ subregion: string;
18
+ partOf: string[];
19
+ memberOf: string[];
20
+ timezones: string[];
21
+ drivingSide: string;
22
+ independent: boolean;
23
+ unMember: boolean;
24
+ systemOfGovernment?: string;
25
+ };
26
+ declare const Countries: Record<string, CountryData>;
27
+ declare const CountryCodes: string[];
28
+ declare const CurrencyCodes: string[];
29
+ declare const Languages: string[];
30
+ declare const Continents: string[];
31
+ declare const Subregions: string[];
32
+ declare const Timezones: string[];
33
+
34
+ declare class CommonGeographyFunction extends FunctionExpression {
35
+ constructor(name: string, args: Expression[]);
36
+ expectsParameters(): TypedParameter[];
37
+ returnsType(checker?: TypeChecker): AtomicType | ArrayType | ObjectType | ObjectArrayType;
38
+ checkTypes(checker?: TypeChecker): ValidationResult;
39
+ evaluate(context: WorkingContext): string | string[] | boolean;
40
+ private findCountry;
41
+ }
42
+ declare class CommonGeographyFunctionsProvider {
43
+ private static _names;
44
+ static names(): string[];
45
+ static create(name: string, args: Expression[]): CommonGeographyFunction | undefined;
46
+ static mock(name: string, args: Expression[]): CommonGeographyFunction | undefined;
47
+ static toJS(name: string): {
48
+ args: string[];
49
+ body: string;
50
+ };
51
+ }
52
+
53
+ declare function registerWorldProviders(): void;
54
+ declare function unregisterWorldProviders(): void;
55
+
56
+ export { CommonGeographyFunction, CommonGeographyFunctionsProvider, Continents, Countries, CountryCodes, type CountryData, CurrencyCodes, Languages, Subregions, Timezones, registerWorldProviders, unregisterWorldProviders };
@@ -0,0 +1,56 @@
1
+ import { FunctionExpression, Expression, TypedParameter, TypeChecker, AtomicType, ArrayType, ObjectType, ObjectArrayType, ValidationResult, WorkingContext } from '@samatawy/rules';
2
+
3
+ type CountryData = {
4
+ name: string;
5
+ officialName: string;
6
+ alias: string[];
7
+ twoLetterCode: string;
8
+ threeLetterCode: string;
9
+ callingCodes: string[];
10
+ topLevelDomains: string[];
11
+ languages: string[];
12
+ capital: string;
13
+ currency: string;
14
+ currencyName: string;
15
+ currencySymbol: string;
16
+ continent: string;
17
+ subregion: string;
18
+ partOf: string[];
19
+ memberOf: string[];
20
+ timezones: string[];
21
+ drivingSide: string;
22
+ independent: boolean;
23
+ unMember: boolean;
24
+ systemOfGovernment?: string;
25
+ };
26
+ declare const Countries: Record<string, CountryData>;
27
+ declare const CountryCodes: string[];
28
+ declare const CurrencyCodes: string[];
29
+ declare const Languages: string[];
30
+ declare const Continents: string[];
31
+ declare const Subregions: string[];
32
+ declare const Timezones: string[];
33
+
34
+ declare class CommonGeographyFunction extends FunctionExpression {
35
+ constructor(name: string, args: Expression[]);
36
+ expectsParameters(): TypedParameter[];
37
+ returnsType(checker?: TypeChecker): AtomicType | ArrayType | ObjectType | ObjectArrayType;
38
+ checkTypes(checker?: TypeChecker): ValidationResult;
39
+ evaluate(context: WorkingContext): string | string[] | boolean;
40
+ private findCountry;
41
+ }
42
+ declare class CommonGeographyFunctionsProvider {
43
+ private static _names;
44
+ static names(): string[];
45
+ static create(name: string, args: Expression[]): CommonGeographyFunction | undefined;
46
+ static mock(name: string, args: Expression[]): CommonGeographyFunction | undefined;
47
+ static toJS(name: string): {
48
+ args: string[];
49
+ body: string;
50
+ };
51
+ }
52
+
53
+ declare function registerWorldProviders(): void;
54
+ declare function unregisterWorldProviders(): void;
55
+
56
+ export { CommonGeographyFunction, CommonGeographyFunctionsProvider, Continents, Countries, CountryCodes, type CountryData, CurrencyCodes, Languages, Subregions, Timezones, registerWorldProviders, unregisterWorldProviders };