@dgac/nmb2b-client
Version:
EUROCONTROL Network Manager B2B SOAP client
44 lines (41 loc) • 1.63 kB
TypeScript
export { N as NMB2BError } from '../NMB2BError-D-cK-Ofr.js';
import { WithReferenceLocationOnPrefix, ReferenceLocation, WithReferenceLocationOnPrefixOptional } from '../Airspace/types.js';
import '../types-B66r3qfk.js';
import 'type-fest';
/**
* 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;
export { extractReferenceLocation };