@openframe-org/criteria-set-protocol 1.4.0 → 1.4.2
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/dist/v1/types/criteria.d.ts +12 -8
- package/package.json +1 -1
|
@@ -115,18 +115,21 @@ export type DataMap = {
|
|
|
115
115
|
result: any;
|
|
116
116
|
};
|
|
117
117
|
export type CertificateDefinitionType = 'number' | 'percentage';
|
|
118
|
-
type
|
|
118
|
+
type AbstractCertificateDefinitionRules<Rules> = Rules extends undefined | never ? {
|
|
119
|
+
rules?: never;
|
|
120
|
+
rulesText?: string;
|
|
121
|
+
} : {
|
|
122
|
+
rules: Rules;
|
|
123
|
+
rulesText: string;
|
|
124
|
+
};
|
|
125
|
+
type AbstractCertificateDefinition<Type extends CertificateDefinitionType, Rules> = AbstractCertificateDefinitionRules<Rules> & {
|
|
119
126
|
code: string;
|
|
120
127
|
type: Type;
|
|
121
128
|
icon?: string;
|
|
122
129
|
name: string;
|
|
123
130
|
description?: string;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
} : {
|
|
127
|
-
rules: Rules;
|
|
128
|
-
});
|
|
129
|
-
type NumberBasedCertificateDefinitionRules = ({
|
|
131
|
+
};
|
|
132
|
+
export type NumberBasedCertificateDefinitionRules = ({
|
|
130
133
|
minimum?: number;
|
|
131
134
|
exclusiveMinimum?: never;
|
|
132
135
|
} | {
|
|
@@ -139,7 +142,8 @@ type NumberBasedCertificateDefinitionRules = ({
|
|
|
139
142
|
maximum?: never;
|
|
140
143
|
exclusiveMaximum?: number;
|
|
141
144
|
});
|
|
145
|
+
export type PercentageBasedCertificateDefinitionRules = NumberBasedCertificateDefinitionRules;
|
|
142
146
|
export type NumberBasedCertificateDefinition = AbstractCertificateDefinition<'number', NumberBasedCertificateDefinitionRules>;
|
|
143
|
-
export type PercentageBasedCertificateDefinition = AbstractCertificateDefinition<'percentage',
|
|
147
|
+
export type PercentageBasedCertificateDefinition = AbstractCertificateDefinition<'percentage', PercentageBasedCertificateDefinitionRules>;
|
|
144
148
|
export type CertificateDefinition = NumberBasedCertificateDefinition | PercentageBasedCertificateDefinition;
|
|
145
149
|
export {};
|
package/package.json
CHANGED