Skip to content

Commit 99662e6

Browse files
committed
Improve some types
1 parent 12d77ab commit 99662e6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/client/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ declare module fng {
7979
text?: string; // the literal value used for the link. If this property is omitted then text is generated from the field values of the document referred to by the link.
8080
}
8181

82+
export type FieldSizeString = 'mini' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'block-level'; // sets control width. Default is 'medium''
83+
8284
export interface IFngSchemaTypeFormOpts {
8385
/*
8486
The input type to be generated - which must be compatible with the Mongoose type.
@@ -110,7 +112,7 @@ declare module fng {
110112
popup?: string; // adds title (popup help) as specified.
111113
ariaLabel?: string; // adds aria-label as specified.
112114
order?: number; // allows user to specify the order / tab order of this field in the form. This overrides the position in the Mongoose schema.
113-
size?: 'mini' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'block-level'; // sets control width. Default is 'medium''
115+
size?: FieldSizeString;
114116
readonly?: boolean | string; // adds the readonly or ng-readonly attribute to the generated input (currently doesn't work with date - and perhaps other types).
115117
rows?: number | 'auto'; // sets the number of rows in inputs (such as textarea) that support this. Setting rows to "auto" makes the textarea expand to fit the content, rather than create a scrollbar.
116118
tab?: string; // Used to divide a large form up into a tabset with multiple tabs

src/client/js/services/input-size-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module fng.services {
66
export function inputSizeHelper() {
77

88
var sizeMapping = [1, 2, 4, 6, 8, 10, 12];
9-
var sizeDescriptions = ['mini', 'small', 'medium', 'large', 'xlarge', 'xxlarge', 'block-level'];
9+
var sizeDescriptions: FieldSizeString[] = ['mini', 'small', 'medium', 'large', 'xlarge', 'xxlarge', 'block-level'];
1010
var defaultSizeOffset = 2; // medium, which was the default for Twitter Bootstrap 2
1111

1212
return {

0 commit comments

Comments
 (0)