feat(editor): Add missing extension methods for expressions (#8845)

This commit is contained in:
Elias Meire
2024-03-20 12:05:54 +01:00
committed by GitHub
parent 7176cd1407
commit 5e84c2ab89
28 changed files with 809 additions and 39 deletions

View File

@@ -0,0 +1,16 @@
import type { NativeDoc } from '@/Extensions/Extensions';
export const booleanMethods: NativeDoc = {
typeName: 'Boolean',
functions: {
toString: {
doc: {
name: 'toString',
description: 'returns a string representing this boolean value.',
docURL:
'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean/toString',
returnType: 'string',
},
},
},
};

View File

@@ -6,6 +6,7 @@ export const numberMethods: NativeDoc = {
toFixed: {
doc: {
name: 'toFixed',
hidden: true,
description:
'Formats a number using fixed-point notation. `digits` defaults to null if not given.',
docURL:
@@ -17,6 +18,7 @@ export const numberMethods: NativeDoc = {
toPrecision: {
doc: {
name: 'toPrecision',
hidden: true,
description: 'Returns a string representing the number to the specified precision.',
docURL:
'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision',
@@ -24,5 +26,14 @@ export const numberMethods: NativeDoc = {
args: [{ name: 'precision?', type: 'number' }],
},
},
toString: {
doc: {
name: 'toString',
description: 'returns a string representing this number value.',
docURL:
'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString',
returnType: 'string',
},
},
},
};

View File

@@ -3,7 +3,14 @@ import { arrayMethods } from './Array.methods';
import { numberMethods } from './Number.methods';
import { objectMethods } from './Object.Methods';
import type { NativeDoc } from '@/Extensions/Extensions';
import { booleanMethods } from './Boolean.methods';
const NATIVE_METHODS: NativeDoc[] = [stringMethods, arrayMethods, numberMethods, objectMethods];
const NATIVE_METHODS: NativeDoc[] = [
stringMethods,
arrayMethods,
numberMethods,
objectMethods,
booleanMethods,
];
export { NATIVE_METHODS as NativeMethods };