mirror of
https://github.com/directus/directus.git
synced 2026-02-08 03:35:18 -05:00
Clean up interface options type (#9447)
This commit is contained in:
committed by
GitHub
parent
2bf8282cc2
commit
ae15f39091
@@ -1,4 +1,4 @@
|
||||
import { ExtensionsOptionsContext } from '@directus/shared/types';
|
||||
import { DeepPartial, Field } from '@directus/shared/types';
|
||||
import { defineInterface } from '@directus/shared/utils';
|
||||
import CodeMirror from 'codemirror';
|
||||
import 'codemirror/mode/meta';
|
||||
@@ -38,8 +38,8 @@ export default defineInterface({
|
||||
types: ['string', 'json', 'text', 'geometry'],
|
||||
group: 'standard',
|
||||
preview: PreviewSVG,
|
||||
options: ({ field }: ExtensionsOptionsContext) => {
|
||||
const sharedOptions = [
|
||||
options: ({ field }) => {
|
||||
const sharedOptions: DeepPartial<Field>[] = [
|
||||
{
|
||||
field: 'lineNumber',
|
||||
name: '$t:interfaces.input-code.line_number',
|
||||
@@ -69,7 +69,7 @@ export default defineInterface({
|
||||
},
|
||||
];
|
||||
|
||||
const defaultOptions = [
|
||||
const defaultOptions: DeepPartial<Field>[] = [
|
||||
{
|
||||
field: 'language',
|
||||
name: '$t:language',
|
||||
@@ -83,7 +83,7 @@ export default defineInterface({
|
||||
...sharedOptions,
|
||||
];
|
||||
|
||||
const jsonOptions = [...sharedOptions];
|
||||
const jsonOptions: DeepPartial<Field>[] = [...sharedOptions];
|
||||
|
||||
if (field?.type === 'json') {
|
||||
return jsonOptions;
|
||||
|
||||
Reference in New Issue
Block a user