Skip to content

Commit 2bcef12

Browse files
committed
refactor: simplify types
1 parent 23ebc59 commit 2bcef12

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

packages/runtime-core/src/define.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="../../../runtime/v1/global.d.ts" />
22

3+
import type { ApprovedLicense } from '@opendatacapture/licenses';
34
import type { z } from 'zod';
45

56
import type { InstrumentKind, InstrumentLanguage } from './types/instrument.base.js';
@@ -11,9 +12,6 @@ declare global {
1112
interface OpenDataCaptureContext {}
1213
}
1314

14-
/** @public */
15-
export type IsOpenDataCaptureRepo = OpenDataCaptureContext['isRepo'];
16-
1715
/** @public */
1816
// prettier-ignore
1917
export type DiscriminatedInstrument<
@@ -42,7 +40,13 @@ export type InstrumentDef<
4240
kind: TKind;
4341
language: TLanguage;
4442
validationSchema: TSchema;
45-
};
43+
} & (OpenDataCaptureContext extends { isRepo: true }
44+
? {
45+
details: {
46+
license: ApprovedLicense;
47+
};
48+
}
49+
: unknown);
4650

4751
/** @public */
4852
export function defineInstrument<

0 commit comments

Comments
 (0)