@flightloop/sdk-frontend 0.0.0-stage → 1.0.0-qa.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.
- package/README.md +145 -2
- package/dist/cjs/core/airspace/index.js +14 -0
- package/dist/cjs/core/airspace/index.js.map +1 -0
- package/dist/cjs/core/airspace/validation-client.js +112 -0
- package/dist/cjs/core/airspace/validation-client.js.map +1 -0
- package/dist/cjs/core/formatters/index.js +41 -0
- package/dist/cjs/core/formatters/index.js.map +1 -0
- package/dist/cjs/core/geometry/circle.js +137 -0
- package/dist/cjs/core/geometry/circle.js.map +1 -0
- package/dist/cjs/core/geometry/index.js +26 -0
- package/dist/cjs/core/geometry/index.js.map +1 -0
- package/dist/cjs/core/geometry/operations.js +169 -0
- package/dist/cjs/core/geometry/operations.js.map +1 -0
- package/dist/cjs/core/geometry/polygon.js +183 -0
- package/dist/cjs/core/geometry/polygon.js.map +1 -0
- package/dist/cjs/core/index.js +29 -0
- package/dist/cjs/core/index.js.map +1 -0
- package/dist/cjs/core/transformers/index.js +33 -0
- package/dist/cjs/core/transformers/index.js.map +1 -0
- package/dist/cjs/core/utils/constants.js +124 -0
- package/dist/cjs/core/utils/constants.js.map +1 -0
- package/dist/cjs/core/utils/helpers.js +98 -0
- package/dist/cjs/core/utils/helpers.js.map +1 -0
- package/dist/cjs/core/utils/index.js +35 -0
- package/dist/cjs/core/utils/index.js.map +1 -0
- package/dist/cjs/core/utils/timezone.js +52 -0
- package/dist/cjs/core/utils/timezone.js.map +1 -0
- package/dist/cjs/core/validation/index.js +26 -0
- package/dist/cjs/core/validation/index.js.map +1 -0
- package/dist/cjs/core/validation/operator.validator.js +156 -0
- package/dist/cjs/core/validation/operator.validator.js.map +1 -0
- package/dist/cjs/index.js +32 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/react/hooks/index.js +41 -0
- package/dist/cjs/react/hooks/index.js.map +1 -0
- package/dist/cjs/react/index.js +20 -0
- package/dist/cjs/react/index.js.map +1 -0
- package/dist/cjs/types/airspace.types.js +22 -0
- package/dist/cjs/types/airspace.types.js.map +1 -0
- package/dist/cjs/types/authorization.types.js +3 -0
- package/dist/cjs/types/authorization.types.js.map +1 -0
- package/dist/cjs/types/geometry.types.js +4 -0
- package/dist/cjs/types/geometry.types.js.map +1 -0
- package/dist/cjs/types/index.js +7 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/esm/core/airspace/index.js +9 -0
- package/dist/esm/core/airspace/index.js.map +1 -0
- package/dist/esm/core/airspace/validation-client.js +107 -0
- package/dist/esm/core/airspace/validation-client.js.map +1 -0
- package/dist/esm/core/formatters/index.js +35 -0
- package/dist/esm/core/formatters/index.js.map +1 -0
- package/dist/esm/core/geometry/circle.js +98 -0
- package/dist/esm/core/geometry/circle.js.map +1 -0
- package/dist/esm/core/geometry/index.js +7 -0
- package/dist/esm/core/geometry/index.js.map +1 -0
- package/dist/esm/core/geometry/operations.js +125 -0
- package/dist/esm/core/geometry/operations.js.map +1 -0
- package/dist/esm/core/geometry/polygon.js +145 -0
- package/dist/esm/core/geometry/polygon.js.map +1 -0
- package/dist/esm/core/index.js +13 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/core/transformers/index.js +28 -0
- package/dist/esm/core/transformers/index.js.map +1 -0
- package/dist/esm/core/utils/constants.js +121 -0
- package/dist/esm/core/utils/constants.js.map +1 -0
- package/dist/esm/core/utils/helpers.js +83 -0
- package/dist/esm/core/utils/helpers.js.map +1 -0
- package/dist/esm/core/utils/index.js +7 -0
- package/dist/esm/core/utils/index.js.map +1 -0
- package/dist/esm/core/utils/timezone.js +47 -0
- package/dist/esm/core/utils/timezone.js.map +1 -0
- package/dist/esm/core/validation/index.js +10 -0
- package/dist/esm/core/validation/index.js.map +1 -0
- package/dist/esm/core/validation/operator.validator.js +150 -0
- package/dist/esm/core/validation/operator.validator.js.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/react/hooks/index.js +35 -0
- package/dist/esm/react/hooks/index.js.map +1 -0
- package/dist/esm/react/index.js +4 -0
- package/dist/esm/react/index.js.map +1 -0
- package/dist/esm/types/airspace.types.js +19 -0
- package/dist/esm/types/airspace.types.js.map +1 -0
- package/dist/esm/types/authorization.types.js +2 -0
- package/dist/esm/types/authorization.types.js.map +1 -0
- package/dist/esm/types/geometry.types.js +3 -0
- package/dist/esm/types/geometry.types.js.map +1 -0
- package/dist/esm/types/index.js +3 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/types/core/airspace/index.d.ts +8 -0
- package/dist/types/core/airspace/index.d.ts.map +1 -0
- package/dist/types/core/airspace/validation-client.d.ts +86 -0
- package/dist/types/core/airspace/validation-client.d.ts.map +1 -0
- package/dist/types/core/formatters/index.d.ts +28 -0
- package/dist/types/core/formatters/index.d.ts.map +1 -0
- package/dist/types/core/geometry/circle.d.ts +33 -0
- package/dist/types/core/geometry/circle.d.ts.map +1 -0
- package/dist/types/core/geometry/index.d.ts +4 -0
- package/dist/types/core/geometry/index.d.ts.map +1 -0
- package/dist/types/core/geometry/operations.d.ts +72 -0
- package/dist/types/core/geometry/operations.d.ts.map +1 -0
- package/dist/types/core/geometry/polygon.d.ts +25 -0
- package/dist/types/core/geometry/polygon.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +7 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/transformers/index.d.ts +26 -0
- package/dist/types/core/transformers/index.d.ts.map +1 -0
- package/dist/types/core/utils/constants.d.ts +116 -0
- package/dist/types/core/utils/constants.d.ts.map +1 -0
- package/dist/types/core/utils/helpers.d.ts +53 -0
- package/dist/types/core/utils/helpers.d.ts.map +1 -0
- package/dist/types/core/utils/index.d.ts +4 -0
- package/dist/types/core/utils/index.d.ts.map +1 -0
- package/dist/types/core/utils/timezone.d.ts +23 -0
- package/dist/types/core/utils/timezone.d.ts.map +1 -0
- package/dist/types/core/validation/index.d.ts +9 -0
- package/dist/types/core/validation/index.d.ts.map +1 -0
- package/dist/types/core/validation/operator.validator.d.ts +35 -0
- package/dist/types/core/validation/operator.validator.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/react/hooks/index.d.ts +27 -0
- package/dist/types/react/hooks/index.d.ts.map +1 -0
- package/dist/types/react/index.d.ts +2 -0
- package/dist/types/react/index.d.ts.map +1 -0
- package/dist/types/types/airspace.types.d.ts +109 -0
- package/dist/types/types/airspace.types.d.ts.map +1 -0
- package/dist/types/types/authorization.types.d.ts +124 -0
- package/dist/types/types/authorization.types.d.ts.map +1 -0
- package/dist/types/types/geometry.types.d.ts +77 -0
- package/dist/types/types/geometry.types.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +5 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +84 -4
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { ERROR_CODES } from '../utils/constants';
|
|
2
|
+
/**
|
|
3
|
+
* Validate email address
|
|
4
|
+
*
|
|
5
|
+
* @param email - Email address
|
|
6
|
+
* @returns Validation result
|
|
7
|
+
*/
|
|
8
|
+
export function validateEmail(email) {
|
|
9
|
+
const errors = [];
|
|
10
|
+
if (!email || typeof email !== 'string') {
|
|
11
|
+
errors.push({
|
|
12
|
+
field: 'email',
|
|
13
|
+
message: 'Email is required',
|
|
14
|
+
code: ERROR_CODES.REQUIRED_FIELD_MISSING,
|
|
15
|
+
});
|
|
16
|
+
return { valid: false, errors };
|
|
17
|
+
}
|
|
18
|
+
// Basic email validation
|
|
19
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
20
|
+
if (!emailRegex.test(email)) {
|
|
21
|
+
errors.push({
|
|
22
|
+
field: 'email',
|
|
23
|
+
message: 'Invalid email address format',
|
|
24
|
+
code: ERROR_CODES.INVALID_EMAIL,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
valid: errors.length === 0,
|
|
29
|
+
errors,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Validate phone number
|
|
34
|
+
*
|
|
35
|
+
* @param phone - Phone number
|
|
36
|
+
* @returns Validation result
|
|
37
|
+
*/
|
|
38
|
+
export function validatePhone(phone) {
|
|
39
|
+
const errors = [];
|
|
40
|
+
if (!phone || typeof phone !== 'string') {
|
|
41
|
+
errors.push({
|
|
42
|
+
field: 'phone',
|
|
43
|
+
message: 'Phone number is required',
|
|
44
|
+
code: ERROR_CODES.REQUIRED_FIELD_MISSING,
|
|
45
|
+
});
|
|
46
|
+
return { valid: false, errors };
|
|
47
|
+
}
|
|
48
|
+
// Remove common phone number formatting characters
|
|
49
|
+
const cleaned = phone.replace(/[\s\-\(\)\+\.]/g, '');
|
|
50
|
+
// Check if it's a valid phone number (10+ digits)
|
|
51
|
+
if (!/^\d{10,}$/.test(cleaned)) {
|
|
52
|
+
errors.push({
|
|
53
|
+
field: 'phone',
|
|
54
|
+
message: 'Invalid phone number format (must be at least 10 digits)',
|
|
55
|
+
code: ERROR_CODES.INVALID_PHONE,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
valid: errors.length === 0,
|
|
60
|
+
errors,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Validate FAA registration ID
|
|
65
|
+
*
|
|
66
|
+
* @param faaId - FAA registration ID
|
|
67
|
+
* @returns Validation result
|
|
68
|
+
*/
|
|
69
|
+
export function validateFAAId(faaId) {
|
|
70
|
+
const errors = [];
|
|
71
|
+
if (!faaId || typeof faaId !== 'string') {
|
|
72
|
+
errors.push({
|
|
73
|
+
field: 'faaId',
|
|
74
|
+
message: 'FAA registration ID is required',
|
|
75
|
+
code: ERROR_CODES.REQUIRED_FIELD_MISSING,
|
|
76
|
+
});
|
|
77
|
+
return { valid: false, errors };
|
|
78
|
+
}
|
|
79
|
+
// FAA ID should be alphanumeric and reasonable length
|
|
80
|
+
const cleaned = faaId.trim();
|
|
81
|
+
if (cleaned.length < 3 || cleaned.length > 20) {
|
|
82
|
+
errors.push({
|
|
83
|
+
field: 'faaId',
|
|
84
|
+
message: 'FAA registration ID must be between 3 and 20 characters',
|
|
85
|
+
code: ERROR_CODES.INVALID_FAA_ID,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
valid: errors.length === 0,
|
|
90
|
+
errors,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Validate operator information
|
|
95
|
+
*
|
|
96
|
+
* @param operator - Operator information
|
|
97
|
+
* @returns Validation result
|
|
98
|
+
*/
|
|
99
|
+
export function validateOperator(operator) {
|
|
100
|
+
const errors = [];
|
|
101
|
+
// Validate name
|
|
102
|
+
if (!operator.name || typeof operator.name !== 'string' || operator.name.trim().length === 0) {
|
|
103
|
+
errors.push({
|
|
104
|
+
field: 'name',
|
|
105
|
+
message: 'Operator name is required',
|
|
106
|
+
code: ERROR_CODES.REQUIRED_FIELD_MISSING,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
// Validate email
|
|
110
|
+
if (operator.email) {
|
|
111
|
+
const emailValidation = validateEmail(operator.email);
|
|
112
|
+
errors.push(...emailValidation.errors);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
errors.push({
|
|
116
|
+
field: 'email',
|
|
117
|
+
message: 'Email is required',
|
|
118
|
+
code: ERROR_CODES.REQUIRED_FIELD_MISSING,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
// Validate phone
|
|
122
|
+
if (operator.phone) {
|
|
123
|
+
const phoneValidation = validatePhone(operator.phone);
|
|
124
|
+
errors.push(...phoneValidation.errors);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
errors.push({
|
|
128
|
+
field: 'phone',
|
|
129
|
+
message: 'Phone number is required',
|
|
130
|
+
code: ERROR_CODES.REQUIRED_FIELD_MISSING,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
// Validate FAA ID
|
|
134
|
+
if (operator.faaId) {
|
|
135
|
+
const faaIdValidation = validateFAAId(operator.faaId);
|
|
136
|
+
errors.push(...faaIdValidation.errors);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
errors.push({
|
|
140
|
+
field: 'faaId',
|
|
141
|
+
message: 'FAA registration ID is required',
|
|
142
|
+
code: ERROR_CODES.REQUIRED_FIELD_MISSING,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
valid: errors.length === 0,
|
|
147
|
+
errors,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=operator.validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator.validator.js","sourceRoot":"","sources":["../../../../src/core/validation/operator.validator.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @flyzone/sdk-frontend
|
|
3
|
+
*
|
|
4
|
+
* Frontend SDK for LAANC authorization - provides UI components and business
|
|
5
|
+
* logic for drone flight authorization.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
// ─── Core Module (Framework-agnostic) ────────────────────────────────────────
|
|
10
|
+
export * from './core';
|
|
11
|
+
// ─── Types ───────────────────────────────────────────────────────────────────
|
|
12
|
+
export * from './types';
|
|
13
|
+
// ─── Version ─────────────────────────────────────────────────────────────────
|
|
14
|
+
export const VERSION = '1.0.0';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gFAAgF;AAChF,cAAc,QAAQ,CAAC;AAEvB,gFAAgF;AAChF,cAAc,SAAS,CAAC;AAExB,gFAAgF;AAChF,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React hooks for LAANC authorization
|
|
3
|
+
*
|
|
4
|
+
* These hooks will be implemented in future iterations to provide
|
|
5
|
+
* React-specific state management for the SDK.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Hook for managing geometry state (circle/polygon)
|
|
9
|
+
* TODO: Implement useGeometry hook
|
|
10
|
+
*/
|
|
11
|
+
export function useGeometry() {
|
|
12
|
+
throw new Error('Not implemented yet - React hooks will be added in next iteration');
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Hook for processing authorization
|
|
16
|
+
* TODO: Implement useAuthorization hook
|
|
17
|
+
*/
|
|
18
|
+
export function useAuthorization() {
|
|
19
|
+
throw new Error('Not implemented yet - React hooks will be added in next iteration');
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Hook for managing operation parameters
|
|
23
|
+
* TODO: Implement useOperationParams hook
|
|
24
|
+
*/
|
|
25
|
+
export function useOperationParams() {
|
|
26
|
+
throw new Error('Not implemented yet - React hooks will be added in next iteration');
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Hook for timezone detection
|
|
30
|
+
* TODO: Implement useTimezone hook
|
|
31
|
+
*/
|
|
32
|
+
export function useTimezone() {
|
|
33
|
+
throw new Error('Not implemented yet - React hooks will be added in next iteration');
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;AACvF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;AACvF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;AACvF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,cAAc,SAAS,CAAC;AAExB,kFAAkF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Airspace feature type classifications
|
|
3
|
+
*/
|
|
4
|
+
export var AirspaceFeatureType;
|
|
5
|
+
(function (AirspaceFeatureType) {
|
|
6
|
+
AirspaceFeatureType["UASFM"] = "UASFM";
|
|
7
|
+
AirspaceFeatureType["CLASS_B"] = "CLASS_B";
|
|
8
|
+
AirspaceFeatureType["CLASS_C"] = "CLASS_C";
|
|
9
|
+
AirspaceFeatureType["CLASS_D"] = "CLASS_D";
|
|
10
|
+
AirspaceFeatureType["CLASS_E"] = "CLASS_E";
|
|
11
|
+
AirspaceFeatureType["DC_FRZ"] = "DC_FRZ";
|
|
12
|
+
AirspaceFeatureType["NSUFR"] = "NSUFR";
|
|
13
|
+
AirspaceFeatureType["PNSUFR"] = "PNSUFR";
|
|
14
|
+
AirspaceFeatureType["SPECIAL_USE"] = "SPECIAL_USE";
|
|
15
|
+
AirspaceFeatureType["TFR"] = "TFR";
|
|
16
|
+
AirspaceFeatureType["SEAM"] = "SEAM";
|
|
17
|
+
AirspaceFeatureType["B4UFLY"] = "B4UFLY";
|
|
18
|
+
})(AirspaceFeatureType || (AirspaceFeatureType = {}));
|
|
19
|
+
//# sourceMappingURL=airspace.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"airspace.types.js","sourceRoot":"","sources":["../../../src/types/airspace.types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,mBAaX;AAbD,WAAY,mBAAmB;IAC7B,sCAAe,CAAA;IACf,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;IACnB,wCAAiB,CAAA;IACjB,sCAAe,CAAA;IACf,wCAAiB,CAAA;IACjB,kDAA2B,CAAA;IAC3B,kCAAW,CAAA;IACX,oCAAa,CAAA;IACb,wCAAiB,CAAA;AACnB,CAAC,EAbW,mBAAmB,KAAnB,mBAAmB,QAa9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization.types.js","sourceRoot":"","sources":["../../../src/types/authorization.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.types.js","sourceRoot":"","sources":["../../../src/types/geometry.types.ts"],"names":[],"mappings":"AAAA,oDAAoD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAcA,gFAAgF;AAChF,OAAO,EACL,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Airspace validation client
|
|
3
|
+
*
|
|
4
|
+
* This module provides an HTTP client for validating flight operations
|
|
5
|
+
* against LAANC airspace restrictions by calling your backend service.
|
|
6
|
+
*/
|
|
7
|
+
export { ValidationClient, createValidationClient, type ValidationClientConfig, } from './validation-client';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/airspace/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation Client - HTTP client for calling your backend validation service
|
|
3
|
+
*
|
|
4
|
+
* This module provides an HTTP client for validating flight operations against
|
|
5
|
+
* LAANC airspace restrictions by calling your backend service, which in turn
|
|
6
|
+
* uses the flyzone-backend SDK to call the Flyzone API.
|
|
7
|
+
*
|
|
8
|
+
* Flow: Frontend App → Your Backend Service → Flyzone API
|
|
9
|
+
*/
|
|
10
|
+
import type { AirspaceValidationRequest, AirspaceValidationResponse } from '@flyzone/sdk-core';
|
|
11
|
+
export interface ValidationClientConfig {
|
|
12
|
+
/**
|
|
13
|
+
* Base URL of your backend service
|
|
14
|
+
* @example 'https://your-backend.com' or 'http://localhost:3000'
|
|
15
|
+
*/
|
|
16
|
+
backendBaseURL: string;
|
|
17
|
+
/**
|
|
18
|
+
* Path to the validation endpoint on your backend
|
|
19
|
+
* @default '/api/airspace/validate'
|
|
20
|
+
*/
|
|
21
|
+
validationPath?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional headers to include with requests (e.g., authentication tokens)
|
|
24
|
+
*/
|
|
25
|
+
headers?: Record<string, string>;
|
|
26
|
+
/**
|
|
27
|
+
* Request timeout in milliseconds
|
|
28
|
+
* @default 30000 (30 seconds)
|
|
29
|
+
*/
|
|
30
|
+
timeout?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* HTTP client for airspace validation
|
|
34
|
+
*
|
|
35
|
+
* This client calls YOUR backend service, which should use the flyzone-backend
|
|
36
|
+
* SDK to communicate with the Flyzone API.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* import { createValidationClient } from '@flyzone/sdk-frontend';
|
|
41
|
+
*
|
|
42
|
+
* const validationClient = createValidationClient({
|
|
43
|
+
* backendBaseURL: 'https://your-backend.com',
|
|
44
|
+
* headers: {
|
|
45
|
+
* 'Authorization': 'Bearer your-user-token'
|
|
46
|
+
* }
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* const result = await validationClient.validate({
|
|
50
|
+
* geometry: {
|
|
51
|
+
* type: 'Polygon',
|
|
52
|
+
* coordinates: [[[lon, lat], ...]]
|
|
53
|
+
* },
|
|
54
|
+
* startTime: '2024-03-15T14:00:00Z',
|
|
55
|
+
* endTime: '2024-03-15T16:00:00Z',
|
|
56
|
+
* timezone: 'America/Los_Angeles',
|
|
57
|
+
* maxAltitude: 100,
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare class ValidationClient {
|
|
62
|
+
private readonly config;
|
|
63
|
+
constructor(config: ValidationClientConfig);
|
|
64
|
+
/**
|
|
65
|
+
* Validates a flight operation against LAANC airspace restrictions
|
|
66
|
+
*
|
|
67
|
+
* @param params - Validation request parameters
|
|
68
|
+
* @returns Promise resolving to validation response
|
|
69
|
+
* @throws Error if the request fails or times out
|
|
70
|
+
*/
|
|
71
|
+
validate(params: AirspaceValidationRequest): Promise<AirspaceValidationResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Updates the authentication token or other headers
|
|
74
|
+
*
|
|
75
|
+
* @param headers - New headers to merge with existing headers
|
|
76
|
+
*/
|
|
77
|
+
updateHeaders(headers: Record<string, string>): void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Factory function to create a validation client
|
|
81
|
+
*
|
|
82
|
+
* @param config - Client configuration
|
|
83
|
+
* @returns ValidationClient instance
|
|
84
|
+
*/
|
|
85
|
+
export declare function createValidationClient(config: ValidationClientConfig): ValidationClient;
|
|
86
|
+
//# sourceMappingURL=validation-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-client.d.ts","sourceRoot":"","sources":["../../../../src/core/airspace/validation-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;gBAE9C,MAAM,EAAE,sBAAsB;IAS1C;;;;;;OAMG;IACG,QAAQ,CACZ,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,0BAA0B,CAAC;IA2CtC;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;CAGrD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,gBAAgB,CAElB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data formatting utilities
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities to format data for API submission
|
|
5
|
+
* and UI display.
|
|
6
|
+
*/
|
|
7
|
+
import type { OperationPayload } from '../../types';
|
|
8
|
+
/**
|
|
9
|
+
* Format operation data for backend API submission
|
|
10
|
+
* TODO: Implement operation payload formatting
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatOperationPayload(_operationData: any): OperationPayload;
|
|
13
|
+
/**
|
|
14
|
+
* Format date/time with timezone to ISO string
|
|
15
|
+
* TODO: Implement datetime formatting
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatDateTime(_date: Date, _timezone: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Format advisories for UI display
|
|
20
|
+
* TODO: Implement advisory formatting
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatAdvisories(_advisories: any[]): any[];
|
|
23
|
+
/**
|
|
24
|
+
* Format airspace class name
|
|
25
|
+
* TODO: Implement class name formatting
|
|
26
|
+
*/
|
|
27
|
+
export declare function formatAirspaceClass(_classCode: string): string;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/formatters/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,GAAG,GAAG,gBAAgB,CAE5E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAE1D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE9D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Feature, Polygon } from 'geojson';
|
|
2
|
+
import type { LatLng, CircleOptions, ValidationResult } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Create a circular polygon from a center point and radius
|
|
5
|
+
*
|
|
6
|
+
* @param center - Center point of the circle
|
|
7
|
+
* @param radiusFeet - Radius in feet
|
|
8
|
+
* @param options - Circle creation options
|
|
9
|
+
* @returns GeoJSON Feature with Polygon geometry
|
|
10
|
+
*/
|
|
11
|
+
export declare function createCircle(center: LatLng, radiusFeet: number, options?: CircleOptions): Feature<Polygon>;
|
|
12
|
+
/**
|
|
13
|
+
* Validate circle parameters
|
|
14
|
+
*
|
|
15
|
+
* @param radiusFeet - Radius in feet
|
|
16
|
+
* @returns Validation result
|
|
17
|
+
*/
|
|
18
|
+
export declare function validateCircle(radiusFeet: number): ValidationResult;
|
|
19
|
+
/**
|
|
20
|
+
* Get the center point of a circle geometry
|
|
21
|
+
*
|
|
22
|
+
* @param circle - Circle feature
|
|
23
|
+
* @returns Center point as LatLng
|
|
24
|
+
*/
|
|
25
|
+
export declare function getCircleCenter(circle: Feature<Polygon>): LatLng | null;
|
|
26
|
+
/**
|
|
27
|
+
* Get the radius of a circle geometry
|
|
28
|
+
*
|
|
29
|
+
* @param circle - Circle feature
|
|
30
|
+
* @returns Radius in feet, or null if not a circle
|
|
31
|
+
*/
|
|
32
|
+
export declare function getCircleRadius(circle: Feature<Polygon>): number | null;
|
|
33
|
+
//# sourceMappingURL=circle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle.d.ts","sourceRoot":"","sources":["../../../../src/core/geometry/circle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI3E;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,OAAO,CAAC,CA2BlB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,CA+BnE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAYvE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAEvE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createCircle, validateCircle, getCircleCenter, getCircleRadius, } from './circle';
|
|
2
|
+
export { createPolygon, validatePolygon, getPolygonPoints, } from './polygon';
|
|
3
|
+
export { calculateArea, calculatePerimeter, calculateCentroid, calculateIntersection, checkIntersection, checkContains, calculateDistance, calculateBearing, createBuffer, } from './operations';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/geometry/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,aAAa,EACb,eAAe,EACf,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Feature, Geometry } from 'geojson';
|
|
2
|
+
import type { LatLng } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Calculate the area of a geometry in square feet
|
|
5
|
+
*
|
|
6
|
+
* @param geometry - GeoJSON geometry
|
|
7
|
+
* @returns Area in square feet
|
|
8
|
+
*/
|
|
9
|
+
export declare function calculateArea(geometry: Geometry | Feature): number;
|
|
10
|
+
/**
|
|
11
|
+
* Calculate the perimeter/length of a geometry in feet
|
|
12
|
+
*
|
|
13
|
+
* @param geometry - GeoJSON geometry
|
|
14
|
+
* @returns Perimeter/length in feet
|
|
15
|
+
*/
|
|
16
|
+
export declare function calculatePerimeter(geometry: Geometry | Feature): number;
|
|
17
|
+
/**
|
|
18
|
+
* Calculate the centroid of a geometry
|
|
19
|
+
*
|
|
20
|
+
* @param geometry - GeoJSON geometry
|
|
21
|
+
* @returns Centroid as LatLng
|
|
22
|
+
*/
|
|
23
|
+
export declare function calculateCentroid(geometry: Geometry | Feature): LatLng;
|
|
24
|
+
/**
|
|
25
|
+
* Calculate the intersection of two geometries
|
|
26
|
+
*
|
|
27
|
+
* @param geometry1 - First geometry
|
|
28
|
+
* @param geometry2 - Second geometry
|
|
29
|
+
* @returns Intersection geometry, or null if no intersection
|
|
30
|
+
*/
|
|
31
|
+
export declare function calculateIntersection(geometry1: Geometry | Feature, geometry2: Geometry | Feature): Geometry | null;
|
|
32
|
+
/**
|
|
33
|
+
* Check if two geometries intersect
|
|
34
|
+
*
|
|
35
|
+
* @param geometry1 - First geometry
|
|
36
|
+
* @param geometry2 - Second geometry
|
|
37
|
+
* @returns True if geometries intersect
|
|
38
|
+
*/
|
|
39
|
+
export declare function checkIntersection(geometry1: Geometry | Feature, geometry2: Geometry | Feature): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Check if one geometry contains another
|
|
42
|
+
*
|
|
43
|
+
* @param container - Container geometry
|
|
44
|
+
* @param contained - Potentially contained geometry
|
|
45
|
+
* @returns True if container contains the other geometry
|
|
46
|
+
*/
|
|
47
|
+
export declare function checkContains(container: Geometry | Feature, contained: Geometry | Feature): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Calculate distance between two points in feet
|
|
50
|
+
*
|
|
51
|
+
* @param point1 - First point
|
|
52
|
+
* @param point2 - Second point
|
|
53
|
+
* @returns Distance in feet
|
|
54
|
+
*/
|
|
55
|
+
export declare function calculateDistance(point1: LatLng, point2: LatLng): number;
|
|
56
|
+
/**
|
|
57
|
+
* Calculate bearing between two points in degrees
|
|
58
|
+
*
|
|
59
|
+
* @param point1 - Starting point
|
|
60
|
+
* @param point2 - Ending point
|
|
61
|
+
* @returns Bearing in degrees (0-360)
|
|
62
|
+
*/
|
|
63
|
+
export declare function calculateBearing(point1: LatLng, point2: LatLng): number;
|
|
64
|
+
/**
|
|
65
|
+
* Create a buffer around a geometry
|
|
66
|
+
*
|
|
67
|
+
* @param geometry - Input geometry
|
|
68
|
+
* @param radiusFeet - Buffer radius in feet
|
|
69
|
+
* @returns Buffered geometry
|
|
70
|
+
*/
|
|
71
|
+
export declare function createBuffer(geometry: Geometry | Feature, radiusFeet: number): Feature;
|
|
72
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/core/geometry/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAGlE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAGvE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAMtE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,QAAQ,GAAG,OAAO,EAC7B,SAAS,EAAE,QAAQ,GAAG,OAAO,GAC5B,QAAQ,GAAG,IAAI,CAUjB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,QAAQ,GAAG,OAAO,EAC7B,SAAS,EAAE,QAAQ,GAAG,OAAO,GAC5B,OAAO,CAQT;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,QAAQ,GAAG,OAAO,EAC7B,SAAS,EAAE,QAAQ,GAAG,OAAO,GAC5B,OAAO,CAST;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAKxE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMvE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,QAAQ,GAAG,OAAO,EAC5B,UAAU,EAAE,MAAM,GACjB,OAAO,CAIT"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Feature, Polygon } from 'geojson';
|
|
2
|
+
import type { LatLng, PolygonOptions, ValidationResult } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Create a polygon from an array of points
|
|
5
|
+
*
|
|
6
|
+
* @param points - Array of LatLng points
|
|
7
|
+
* @param options - Polygon creation options
|
|
8
|
+
* @returns GeoJSON Feature with Polygon geometry
|
|
9
|
+
*/
|
|
10
|
+
export declare function createPolygon(points: LatLng[], options?: PolygonOptions): Feature<Polygon>;
|
|
11
|
+
/**
|
|
12
|
+
* Validate polygon parameters
|
|
13
|
+
*
|
|
14
|
+
* @param points - Array of LatLng points
|
|
15
|
+
* @returns Validation result
|
|
16
|
+
*/
|
|
17
|
+
export declare function validatePolygon(points: LatLng[]): ValidationResult;
|
|
18
|
+
/**
|
|
19
|
+
* Get the points of a polygon geometry
|
|
20
|
+
*
|
|
21
|
+
* @param polygon - Polygon feature
|
|
22
|
+
* @returns Array of LatLng points
|
|
23
|
+
*/
|
|
24
|
+
export declare function getPolygonPoints(polygon: Feature<Polygon>): LatLng[];
|
|
25
|
+
//# sourceMappingURL=polygon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../../src/core/geometry/polygon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG5E;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,OAAO,CAAC,CA+BlB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAoGlE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,CAKpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAG3B,cAAc,YAAY,CAAC;AAG3B,cAAc,cAAc,CAAC;AAG7B,cAAc,cAAc,CAAC;AAG7B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Airspace feature transformers
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities to transform airspace features from various
|
|
5
|
+
* map data sources into the standardized SDK format.
|
|
6
|
+
*/
|
|
7
|
+
import type { StandardAirspaceFeature } from '../../types';
|
|
8
|
+
/**
|
|
9
|
+
* Transform Mapbox vector tile features to standard format
|
|
10
|
+
* TODO: Implement in future iteration
|
|
11
|
+
*/
|
|
12
|
+
export declare function transformMapboxFeature(_mapboxFeature: any, _layerId: string): StandardAirspaceFeature;
|
|
13
|
+
/**
|
|
14
|
+
* Transform generic GeoJSON features to standard format
|
|
15
|
+
* TODO: Implement in future iteration
|
|
16
|
+
*/
|
|
17
|
+
export declare function transformGenericGeoJSON(_feature: any, _options?: {
|
|
18
|
+
typeMapping?: Record<string, string>;
|
|
19
|
+
propertyMapping?: Record<string, string>;
|
|
20
|
+
}): StandardAirspaceFeature;
|
|
21
|
+
/**
|
|
22
|
+
* Auto-detect and transform features from various sources
|
|
23
|
+
* TODO: Implement in future iteration
|
|
24
|
+
*/
|
|
25
|
+
export declare function transformFeatures(_features: any[], _source?: 'mapbox' | 'geojson' | 'auto'): StandardAirspaceFeature[];
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/transformers/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,GAAG,EACnB,QAAQ,EAAE,MAAM,GACf,uBAAuB,CAEzB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,GAAG,EACb,QAAQ,CAAC,EAAE;IACT,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C,GACA,uBAAuB,CAEzB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,GAAG,EAAE,EAChB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,GACtC,uBAAuB,EAAE,CAE3B"}
|