kintone-pretty-fields 0.4.0 → 0.4.1
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/README.md +11 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -117,20 +117,22 @@ Here is a sample code that retrieves form fields of an app.
|
|
|
117
117
|
|
|
118
118
|
```ts
|
|
119
119
|
import { KintoneRestAPIClient } from "@kintone/rest-api-client";
|
|
120
|
-
import { kintonePrettyFields } from "kintone-pretty-fields";
|
|
120
|
+
import { kintonePrettyFields, kintonePrettyType } from "kintone-pretty-fields";
|
|
121
121
|
|
|
122
122
|
const client = new KintoneRestAPIClient();
|
|
123
123
|
const { fields, spacers } = await kintonePrettyFields.get({ client, app: 1, lang: "en", preview: false });
|
|
124
124
|
console.log({ fields, spacers });
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
const checkBoxFields = fields.filter(kintonePrettyFields.isCheckBox);
|
|
127
|
+
console.log(checkBoxFields);
|
|
128
|
+
|
|
129
|
+
const myFunction1 = (fields: kintonePrettyType.OneOf[]) => {
|
|
130
|
+
// do something
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const myFunction2 = (field: kintonePrettyType.CheckBox) => {
|
|
134
|
+
// do something
|
|
135
|
+
};
|
|
134
136
|
```
|
|
135
137
|
|
|
136
138
|
## License
|