import { AGlideObject } from "../imports/AGlideObject"; import { NativeArray } from "../imports/NativeArray"; import { SysStyleResult } from "../imports/SysStyleResult"; import { GlideappQuestion } from "./GlideappQuestion"; import { GlideChoiceList } from "./GlideChoiceList"; import { GlideElementDescriptor } from "./GlideElementDescriptor"; import { GlideRecord } from "./GlideRecord"; import { MappingLookupSourceDescriptor } from "./MappingLookupSourceDescriptor"; import { SafeTableField, SafeTableFieldKey, } from "./_GlideRecordHelpers/SafeTableTypes"; /** * The Scoped GlideElement API provides methods for dealing with fields and their values. Scoped GlideElement methods * are available for the fields of the current GlideRecord */ export declare class GlideElement { // Scoped GlideElement methods /** * Retrieves the choice list for a field */ getChoices(dependent?: string): NativeArray; /** * Sets the display value of the field */ setDisplayValue(value: any): void; /** * Sets the value of the field */ setValue, V extends SafeTableField>( value: V ): void; getRefRecord(): GlideRecord; /** * Gets the formatted display value of the field */ getDisplayValue(maxCharacters?: number): string; getDisplayValueLang(language: string): string; getHTMLValue(maxChars?: number): string; toString(): string; /** * Gets the field's element descriptor */ getED(): GlideElementDescriptor; getDecryptedValue(): string; getGlideObject(): AGlideObject; getElements(withMRVS: boolean): NativeArray; getQuestion(): GlideappQuestion; // GlideElementReference methods getReferenceTable(): string; // GlideElementBoolean methods /** * Determines if the new value of a field after a change matches a certain object */ changesTo(o: any): boolean; /** * Determines the previous value of the current field matched a certain object */ changesFrom(o: any): boolean; // GlideElementDynamicAttributeStore methods hasValidValue(): boolean; getDynamicAttributesInSchema(): NativeArray; getDynamicAttributesInStore(): NativeArray; getDynamicAttribute(attributePath: string): any; getDynamicAttributeValue(attributePath: string): any; getDynamicAttributeDisplayValue(attributePath: string): any; getDynamicAttributePrimitiveValue(attributePath: string): any; getDynamicNamespace(): any; setDynamicAttributeValue(attributePath: string, value: any): GlideElement; setDynamicAttributeDisplayValue( attributePath: string, value: any ): GlideElement; setDynamicAttributeDisplayValues(values: any): GlideElement; setDynamicAttributeValues(values: any): GlideElement; // GlideElementDynamicAttribute methods isInSchema(): boolean; isTransient(): boolean; hasDefinition(): boolean; hasValidValue(attributePath: string): boolean; // GlideElementCurrency methods getCurrencyCode(): string; getNumericCurrencyCode(): string; getCurrencyDisplayValue(): string; getCurrencyString(): string; getCurrencyValue(): string; getReferenceCurrencyCode(): string; getReferenceDisplayValue(): string; getReferenceValue(): string; getSessionCurrencyCode(): string; getSessionDisplayValue(): string; getSessionValue(): string; // GlideElementGlideObject methods setDateNumericValue(value: any): void; dateNumericValue(dateString: string): number; getJournalEntry(lines: number): string; // GlideElementPhoneNumber methods getCLEDecryptedDBValue(): string; setPhoneNumber(value: any, strict: boolean): boolean; getGlobalDisplayValue(): string; // GlideElementWorkflow methods getProviderType(): string; getStages(): GlideChoiceList; // GlideElementVariables methods getVariablesValue(): string; // GlideElementVariable methods isMultiRow(): boolean; // ITableVariableNode methods /** * Gets the object's label */ getLabel(): string; /** * Determines if the user's role permits creation of new records in this field */ canCreate(): boolean; /** * Determines if the GlideRecord table can be read from */ canRead(): boolean; /** * Determines if the GlideRecord table can be written to */ canWrite(): boolean; getRow(index: number): GlideElement; addRow(): GlideElement; getCells(columnName: string): NativeArray; getQuestionIds(): NativeArray; getRowCount(): number; getRows(): NativeArray; deleteRow(index: number): void; // ITableVariableRowNode methods getCell(name: string): GlideElement; // ITableVariableCellNode methods getCellDisplayValue(): T; getVariableName(): string; getCellValue(): T; setCellValue(value: T): void; isValidCell(): boolean; // GlideElement methods isArray(): boolean; isObject(): boolean; size(): number; isNil(): boolean; explainLock(): string; isDynamicCreate(): boolean; /** * Determines whether the field is null */ nil(): boolean; /** * Determines if the current field has been modified */ changes(): boolean; changesFromNotEmpty(): boolean; changesToNotEmpty(): boolean; constructor(); debug(msg: any): void; elementSupportsMapping(): boolean; /** * Gets the value of the attribute on the field in question from the dictionary as a string. If the attribute is a * boolean attribute, use getBooleanAttribute(String) to get the value as a boolean rathe... */ getAttribute(attribute: string): string; getBaseTableName(): string; /** * Gets the value of the attribute on the field in question from the dictionary as a string. To get the value as a * string, use getAttribute(string) */ getBooleanAttribute(attribute: string): boolean; getChoiceValue(): string; getChoiceValueLang(language: string): string; getContextID(): string; getContextName(): string; getDebugCount(): number; /** * Gets the decrypted value */ getDependent(): string; getDependentTable(): string; getDisplayValueExt(maxCharacters: number, nullsub: string): string; getElementValue(name: string): string; getError(): string; getEscapedValue(): string; getFieldStyle(): string; getFullStyle(): SysStyleResult; getGlideRecord(): GlideRecord; getHTMLValueExt(maxCharacters: number, nullsub: string): string; getHint(): string; getInitialValue(): string; getLabelLang(language: string): string; getMappingConfig(): MappingLookupSourceDescriptor; getModifiedBy(): string; /** * Gets the name of the field */ getName(): string; getReferenceKey(): string; getStyle(): string; /** * Gets the table name */ getTableName(): string; getTextAreaDisplayValue(): string; getValue(): string; getValueMapping(): string; getXHTMLValue(): string; getXMLValue(): string; /** * Determines whether a field has a particular attribute */ hasAttribute(attribute: string): boolean; hasMapping(): boolean; hasRightsTo(operation: string): boolean; hasValue(): boolean; /** * Adds an error message. Can be retrieved using getError() */ setError(error: string): void; setInitialValue(value: string): void; setJournalEntry(value: any, userName: string): void; setValueMapping(mapping: string): void; }