uniforms-bridge-simple-schema
Version:
SimpleSchema bridge for uniforms.
57 lines (53 loc) • 1.12 kB
text/typescript
// @ts-ignore -- This package _is_ typed, but not in all environments.
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { Match } from 'meteor/check';
import { filterDOMProps } from 'uniforms';
// Register custom property.
SimpleSchema.extendOptions({
uniforms: Match.Optional(
Match.OneOf(
String,
Function,
Match.ObjectIncluding({
component: Match.Optional(Match.OneOf(String, Function)),
}),
),
),
});
// There's no possibility to retrieve them at runtime.
declare module 'uniforms' {
interface FilterDOMProps {
autoValue: never;
blackbox: never;
custom: never;
decimal: never;
defaultValue: never;
exclusiveMax: never;
exclusiveMin: never;
max: never;
maxCount: never;
min: never;
minCount: never;
optional: never;
regEx: never;
trim: never;
type: never;
}
}
filterDOMProps.register(
'autoValue',
'blackbox',
'custom',
'decimal',
'defaultValue',
'exclusiveMax',
'exclusiveMin',
'max',
'maxCount',
'min',
'minCount',
'optional',
'regEx',
'trim',
'type',
);