@dgac/nmb2b-client
Version:
EUROCONTROL Network Manager B2B SOAP client
42 lines (41 loc) • 1.63 kB
text/typescript
import { ReferenceLocation, WithReferenceLocationOnPrefix, WithReferenceLocationOnPrefixOptional } from "../Airspace/types.mjs";
//#region src/utils/extractReferenceLocation.d.ts
/**
* Extract a reference location with a given key-prefix from a reply object.
* @param prefix Prefix of the keys of the reference location
* @param input NMB2B object
*
*
* @example
* ```typescript
* const input = {
* 'protectedLocation-ReferenceLocationAirspace': { type: 'AIRSPACE', id: 'LFEEKR' },
* regulationId: 'FOOBAR',
* };
*
* const location = extractReferenceLocation('protectedLocation', input);
* // { type: 'AIRSPACE', id: 'LFEEKR' }
* ```
*/
declare function extractReferenceLocation<const TPrefix extends string, TInput extends WithReferenceLocationOnPrefix<TPrefix>>(prefix: TPrefix, input: TInput): ReferenceLocation;
/**
* Extract a reference location with a given key-prefix from a reply object.
* @param prefix Prefix of the keys of the reference location
* @param input NMB2B object
*
*
* @example
* ```typescript
* const input = {
* 'protectedLocation-ReferenceLocationAirspace': { type: 'AIRSPACE', id: 'LFEEKR' },
* regulationId: 'FOOBAR',
* };
*
* const location = extractReferenceLocation('protectedLocation', input);
* // { type: 'AIRSPACE', id: 'LFEEKR' }
* ```
*/
declare function extractReferenceLocation<const TPrefix extends string, TInput extends undefined | WithReferenceLocationOnPrefixOptional<TPrefix>>(prefix: TPrefix, input: TInput): undefined | ReferenceLocation;
//#endregion
export { extractReferenceLocation };
//# sourceMappingURL=extractReferenceLocation.d.mts.map