type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
// Set touched on blur onTouched(e) { this.element.nativeElement.classList.remove('selected'); this.onModelTouched(); this.blur.emit(e); }
bullhorn/novo-elements
projects/novo-elements/src/elements/chips/Chips.ts
TypeScript
MethodDeclaration
writeValue(model: any): void { this.model = model; this.setItems(); }
bullhorn/novo-elements
projects/novo-elements/src/elements/chips/Chips.ts
TypeScript
MethodDeclaration
registerOnChange(fn: Function): void { this.onModelChange = fn; }
bullhorn/novo-elements
projects/novo-elements/src/elements/chips/Chips.ts
TypeScript
MethodDeclaration
registerOnTouched(fn: Function): void { this.onModelTouched = fn; }
bullhorn/novo-elements
projects/novo-elements/src/elements/chips/Chips.ts
TypeScript
MethodDeclaration
setDisabledState(disabled: boolean): void { this._disablePickerInput = disabled; }
bullhorn/novo-elements
projects/novo-elements/src/elements/chips/Chips.ts
TypeScript
MethodDeclaration
/** * @description This method creates an instance of the preview (called popup) and adds all the bindings to that * instance. Will reuse the popup or create a new one if it does not already exist. Will only work if there is * a previewTemplate given in the config. */ showPreview() { if (this.source.previewTemplate) { if (!this.popup) { this.popup = this.componentUtils.append(this.source.previewTemplate, this.preview); } this.popup.instance.match = this.selected; } }
bullhorn/novo-elements
projects/novo-elements/src/elements/chips/Chips.ts
TypeScript
MethodDeclaration
/** * @description - This method deletes the preview popup from the DOM. */ hidePreview() { if (this.popup) { this.popup.destroy(); this.popup = null; } }
bullhorn/novo-elements
projects/novo-elements/src/elements/chips/Chips.ts
TypeScript
FunctionDeclaration
/* * application/x-www-form-urlencoded代表参数以键值对传递给后台 * application/json代表参数以json字符串传递给后台 * */ function normalizeHeaderName(headers: any, normalizedName: string): void { if (!headers) { return } Object.keys(headers).forEach(name => { if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { headers[normalizedName] = headers[name] delete headers[name] } }) }
zhangli20080808/ts-axios
src/helpers/headers.ts
TypeScript
FunctionDeclaration
export function processHeaders(headers: any, data: any): any { normalizeHeaderName(headers, 'Content-Type') if (isPlainObject(data)) { if (headers && !headers['Content-Type']) { headers['Content-Type'] = 'application/json;charset=utf-8' } } return headers }
zhangli20080808/ts-axios
src/helpers/headers.ts
TypeScript
FunctionDeclaration
export function parseHeaders(headers: string): any { let parsed = Object.create(null) if (!headers) { return parsed } headers.split('\r\n').forEach(line => { let [key, val] = line.split(':') key = key.trim().toLowerCase() if (!key) { return } if (val) { val = val.trim() } parsed[key] = val }) return parsed }
zhangli20080808/ts-axios
src/helpers/headers.ts
TypeScript
ArrowFunction
name => { if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { headers[normalizedName] = headers[name] delete headers[name] } }
zhangli20080808/ts-axios
src/helpers/headers.ts
TypeScript
ArrowFunction
line => { let [key, val] = line.split(':') key = key.trim().toLowerCase() if (!key) { return } if (val) { val = val.trim() } parsed[key] = val }
zhangli20080808/ts-axios
src/helpers/headers.ts
TypeScript
ClassDeclaration
// Ids is a JavaScript project, but we define TypeScript declarations so we can // confirm our code is type safe, and to support TypeScript users. export default class IdsSwitch extends HTMLElement { /** Sets the checked state to true or false */ checked: boolean; /** Sets checkbox to disabled * */ disabled: boolean; /** Sets the checkbox label text * */ label: string; /** Sets the checkbox label font size (rarely used) * */ labelFontSize: 10 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 40 | 48 | 60 | 72 | 'xs' | 'sm ' | 'lg' | 'xl' | string | number; /** Sets the checkbox `value` attribute * */ value: string; }
Robdel12/enterprise-wc
src/ids-switch/ids-switch.d.ts
TypeScript
ArrowFunction
(games: GameModel[]) => { this.games = games; this.performFilter(this.parentListFilter); }
Lemoncode/Angular-Architecture-Fundamentals
angular 8/Demos/08 child components/game-catalog/src/app/games/game-list/game-list.component.ts
TypeScript
ArrowFunction
(g: GameModel) => g.name.toLocaleLowerCase() .indexOf(filterBy.toLocaleLowerCase()) !== -1
Lemoncode/Angular-Architecture-Fundamentals
angular 8/Demos/08 child components/game-catalog/src/app/games/game-list/game-list.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-game-list', templateUrl: './game-list.component.html', styleUrls: ['./game-list.component.css'] }) export class GameListComponent implements OnInit, AfterViewInit { includeDetail = true; showImage: boolean; imageWidth = 50; imageMargin = 2; @ViewChild(CriteriaComponent, { static: false })filterComponent: CriteriaComponent; parentListFilter; filteredGames: GameModel[]; games: GameModel[]; constructor(private gameService: GameService) { } ngAfterViewInit(): void { this.parentListFilter = this.filterComponent.listFilter; } ngOnInit() { this.gameService.getGames().subscribe( (games: GameModel[]) => { this.games = games; this.performFilter(this.parentListFilter); } ) } onValueChange(value: string): void { this.performFilter(value); } performFilter(filterBy?: string): void { if (filterBy) { this.filteredGames = this.games .filter( (g: GameModel) => g.name.toLocaleLowerCase() .indexOf(filterBy.toLocaleLowerCase()) !== -1 ); } else { this.filteredGames = this.games; } } toggleImage(): void { this.showImage = !this.showImage; } }
Lemoncode/Angular-Architecture-Fundamentals
angular 8/Demos/08 child components/game-catalog/src/app/games/game-list/game-list.component.ts
TypeScript
MethodDeclaration
ngAfterViewInit(): void { this.parentListFilter = this.filterComponent.listFilter; }
Lemoncode/Angular-Architecture-Fundamentals
angular 8/Demos/08 child components/game-catalog/src/app/games/game-list/game-list.component.ts
TypeScript
MethodDeclaration
ngOnInit() { this.gameService.getGames().subscribe( (games: GameModel[]) => { this.games = games; this.performFilter(this.parentListFilter); } ) }
Lemoncode/Angular-Architecture-Fundamentals
angular 8/Demos/08 child components/game-catalog/src/app/games/game-list/game-list.component.ts
TypeScript
MethodDeclaration
onValueChange(value: string): void { this.performFilter(value); }
Lemoncode/Angular-Architecture-Fundamentals
angular 8/Demos/08 child components/game-catalog/src/app/games/game-list/game-list.component.ts
TypeScript
MethodDeclaration
performFilter(filterBy?: string): void { if (filterBy) { this.filteredGames = this.games .filter( (g: GameModel) => g.name.toLocaleLowerCase() .indexOf(filterBy.toLocaleLowerCase()) !== -1 ); } else { this.filteredGames = this.games; } }
Lemoncode/Angular-Architecture-Fundamentals
angular 8/Demos/08 child components/game-catalog/src/app/games/game-list/game-list.component.ts
TypeScript
MethodDeclaration
toggleImage(): void { this.showImage = !this.showImage; }
Lemoncode/Angular-Architecture-Fundamentals
angular 8/Demos/08 child components/game-catalog/src/app/games/game-list/game-list.component.ts
TypeScript
ClassDeclaration
class TodoApi { public static prefix = '/todos'; public fetchTodo(userId: string) { return request.get(`${TodoApi.prefix}/${userId}/all`); } public addTodo(userId: string, content: string) { return request.post(`${TodoApi.prefix}`, { userId, content, }); } public searchTodo(userId: string, q: string) { return request.post(`${TodoApi.prefix}/search`, { userId, q, }); } public deleteTodo(todoId: string) { return request.delete(`${TodoApi.prefix}/${todoId}`); } public updateTodoStatus(todoId: string) { return request.put(`${TodoApi.prefix}/status`, { todoId, }); } public updateTodoContent(todoId: string, content: string) { console.log(todoId,content); return request.put(`${TodoApi.prefix}/content`, { todoId, content, }); } }
wangsimiao66/moyu
src/api/todo.ts
TypeScript
MethodDeclaration
public fetchTodo(userId: string) { return request.get(`${TodoApi.prefix}/${userId}/all`); }
wangsimiao66/moyu
src/api/todo.ts
TypeScript
MethodDeclaration
public addTodo(userId: string, content: string) { return request.post(`${TodoApi.prefix}`, { userId, content, }); }
wangsimiao66/moyu
src/api/todo.ts
TypeScript
MethodDeclaration
public searchTodo(userId: string, q: string) { return request.post(`${TodoApi.prefix}/search`, { userId, q, }); }
wangsimiao66/moyu
src/api/todo.ts
TypeScript
MethodDeclaration
public deleteTodo(todoId: string) { return request.delete(`${TodoApi.prefix}/${todoId}`); }
wangsimiao66/moyu
src/api/todo.ts
TypeScript
MethodDeclaration
public updateTodoStatus(todoId: string) { return request.put(`${TodoApi.prefix}/status`, { todoId, }); }
wangsimiao66/moyu
src/api/todo.ts
TypeScript
MethodDeclaration
public updateTodoContent(todoId: string, content: string) { console.log(todoId,content); return request.put(`${TodoApi.prefix}/content`, { todoId, content, }); }
wangsimiao66/moyu
src/api/todo.ts
TypeScript
FunctionDeclaration
/** * @internal */ export function isResourceFileEdit(thing: any): thing is ResourceFileEdit { return isObject(thing) && (Boolean((<ResourceFileEdit>thing).newUri) || Boolean((<ResourceFileEdit>thing).oldUri)); }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
FunctionDeclaration
/** * @internal */ export function isResourceTextEdit(thing: any): thing is ResourceTextEdit { return isObject(thing) && (<ResourceTextEdit>thing).resource && Array.isArray((<ResourceTextEdit>thing).edits); }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
ClassDeclaration
/** * @internal */ export class LanguageIdentifier { /** * A string identifier. Unique across languages. e.g. 'javascript'. */ public readonly language: string; /** * A numeric identifier. Unique across languages. e.g. 5 * Will vary at runtime based on registration order, etc. */ public readonly id: LanguageId; constructor(language: string, id: LanguageId) { this.language = language; this.id = id; } }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
ClassDeclaration
/** * @internal */ export class TokenMetadata { public static getLanguageId(metadata: number): LanguageId { return (metadata & MetadataConsts.LANGUAGEID_MASK) >>> MetadataConsts.LANGUAGEID_OFFSET; } public static getTokenType(metadata: number): StandardTokenType { return (metadata & MetadataConsts.TOKEN_TYPE_MASK) >>> MetadataConsts.TOKEN_TYPE_OFFSET; } public static getFontStyle(metadata: number): FontStyle { return (metadata & MetadataConsts.FONT_STYLE_MASK) >>> MetadataConsts.FONT_STYLE_OFFSET; } public static getForeground(metadata: number): ColorId { return (metadata & MetadataConsts.FOREGROUND_MASK) >>> MetadataConsts.FOREGROUND_OFFSET; } public static getBackground(metadata: number): ColorId { return (metadata & MetadataConsts.BACKGROUND_MASK) >>> MetadataConsts.BACKGROUND_OFFSET; } public static getClassNameFromMetadata(metadata: number): string { let foreground = this.getForeground(metadata); let className = 'mtk' + foreground; let fontStyle = this.getFontStyle(metadata); if (fontStyle & FontStyle.Italic) { className += ' mtki'; } if (fontStyle & FontStyle.Bold) { className += ' mtkb'; } if (fontStyle & FontStyle.Underline) { className += ' mtku'; } return className; } public static getInlineStyleFromMetadata(metadata: number, colorMap: string[]): string { const foreground = this.getForeground(metadata); const fontStyle = this.getFontStyle(metadata); let result = `color: ${colorMap[foreground]};`; if (fontStyle & FontStyle.Italic) { result += 'font-style: italic;'; } if (fontStyle & FontStyle.Bold) { result += 'font-weight: bold;'; } if (fontStyle & FontStyle.Underline) { result += 'text-decoration: underline;'; } return result; } }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
ClassDeclaration
export class FoldingRangeKind { /** * Kind for folding range representing a comment. The value of the kind is 'comment'. */ static readonly Comment = new FoldingRangeKind('comment'); /** * Kind for folding range representing a import. The value of the kind is 'imports'. */ static readonly Imports = new FoldingRangeKind('imports'); /** * Kind for folding range representing regions (for example marked by `#region`, `#endregion`). * The value of the kind is 'region'. */ static readonly Region = new FoldingRangeKind('region'); /** * Creates a new [FoldingRangeKind](#FoldingRangeKind). * * @param value of the kind. */ public constructor(public value: string) { } }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * A mode. Will soon be obsolete. * @internal */ export interface IMode { getId(): string; getLanguageIdentifier(): LanguageIdentifier; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface ITokenizationSupport { getInitialState(): IState; // add offsetDelta to each of the returned indices tokenize(line: string, state: IState, offsetDelta: number): TokenizationResult; tokenize2(line: string, state: IState, offsetDelta: number): TokenizationResult2; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The state of the tokenizer between two lines. * It is useful to store flags such as in multiline comment, etc. * The model will clone the previous line's state and pass it in to tokenize the next line. */ export interface IState { clone(): IState; equals(other: IState): boolean; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * A hover represents additional information for a symbol or word. Hovers are * rendered in a tooltip-like widget. */ export interface Hover { /** * The contents of this hover. */ contents: IMarkdownString[]; /** * The range to which this hover applies. When missing, the * editor will use the range at the current position or the * current position itself. */ range?: IRange; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The hover provider interface defines the contract between extensions and * the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature. */ export interface HoverProvider { /** * Provide a hover for the given position and document. Multiple hovers at the same * position will be merged by the editor. A hover can have a range which defaults * to the word range at the position when omitted. */ provideHover(model: model.ITextModel, position: Position, token: CancellationToken): Hover | Thenable<Hover>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface ISuggestion { label: string; insertText: string; type: SuggestionType; detail?: string; documentation?: string | IMarkdownString; filterText?: string; sortText?: string; preselect?: boolean; noAutoAccept?: boolean; commitCharacters?: string[]; overwriteBefore?: number; overwriteAfter?: number; additionalTextEdits?: model.ISingleEditOperation[]; command?: Command; snippetType?: SnippetType; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface ISuggestResult { suggestions: ISuggestion[]; incomplete?: boolean; dispose?(): void; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface SuggestContext { triggerKind: SuggestTriggerKind; triggerCharacter?: string; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface ISuggestSupport { triggerCharacters?: string[]; provideCompletionItems(model: model.ITextModel, position: Position, context: SuggestContext, token: CancellationToken): ISuggestResult | Thenable<ISuggestResult>; resolveCompletionItem?(model: model.ITextModel, position: Position, item: ISuggestion, token: CancellationToken): ISuggestion | Thenable<ISuggestion>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface CodeAction { title: string; command?: Command; edit?: WorkspaceEdit; diagnostics?: IMarkerData[]; kind?: string; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface CodeActionContext { only?: string; trigger: CodeActionTrigger; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The code action interface defines the contract between extensions and * the [light bulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) feature. * @internal */ export interface CodeActionProvider { /** * Provide commands for the given document and range. */ provideCodeActions(model: model.ITextModel, range: Range | Selection, context: CodeActionContext, token: CancellationToken): CodeAction[] | Thenable<CodeAction[]>; /** * Optional list of of CodeActionKinds that this provider returns. */ providedCodeActionKinds?: string[]; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * Represents a parameter of a callable-signature. A parameter can * have a label and a doc-comment. */ export interface ParameterInformation { /** * The label of this signature. Will be shown in * the UI. */ label: string; /** * The human-readable doc-comment of this signature. Will be shown * in the UI but can be omitted. */ documentation?: string | IMarkdownString; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * Represents the signature of something callable. A signature * can have a label, like a function-name, a doc-comment, and * a set of parameters. */ export interface SignatureInformation { /** * The label of this signature. Will be shown in * the UI. */ label: string; /** * The human-readable doc-comment of this signature. Will be shown * in the UI but can be omitted. */ documentation?: string | IMarkdownString; /** * The parameters of this signature. */ parameters: ParameterInformation[]; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * Signature help represents the signature of something * callable. There can be multiple signatures but only one * active and only one active parameter. */ export interface SignatureHelp { /** * One or more signatures. */ signatures: SignatureInformation[]; /** * The active signature. */ activeSignature: number; /** * The active parameter of the active signature. */ activeParameter: number; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The signature help provider interface defines the contract between extensions and * the [parameter hints](https://code.visualstudio.com/docs/editor/intellisense)-feature. */ export interface SignatureHelpProvider { signatureHelpTriggerCharacters: string[]; /** * Provide help for the signature at the given position and document. */ provideSignatureHelp(model: model.ITextModel, position: Position, token: CancellationToken): SignatureHelp | Thenable<SignatureHelp>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * A document highlight is a range inside a text document which deserves * special attention. Usually a document highlight is visualized by changing * the background color of its range. */ export interface DocumentHighlight { /** * The range this highlight applies to. */ range: IRange; /** * The highlight kind, default is [text](#DocumentHighlightKind.Text). */ kind: DocumentHighlightKind; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The document highlight provider interface defines the contract between extensions and * the word-highlight-feature. */ export interface DocumentHighlightProvider { /** * Provide a set of document highlights, like all occurrences of a variable or * all exit-points of a function. */ provideDocumentHighlights(model: model.ITextModel, position: Position, token: CancellationToken): DocumentHighlight[] | Thenable<DocumentHighlight[]>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * Value-object that contains additional information when * requesting references. */ export interface ReferenceContext { /** * Include the declaration of the current symbol. */ includeDeclaration: boolean; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The reference provider interface defines the contract between extensions and * the [find references](https://code.visualstudio.com/docs/editor/editingevolved#_peek)-feature. */ export interface ReferenceProvider { /** * Provide a set of project-wide references for the given position and document. */ provideReferences(model: model.ITextModel, position: Position, context: ReferenceContext, token: CancellationToken): Location[] | Thenable<Location[]>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * Represents a location inside a resource, such as a line * inside a text file. */ export interface Location { /** * The resource identifier of this location. */ uri: URI; /** * The document range of this locations. */ range: IRange; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface DefinitionLink { origin?: IRange; uri: URI; range: IRange; selectionRange?: IRange; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The definition provider interface defines the contract between extensions and * the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition) * and peek definition features. */ export interface DefinitionProvider { /** * Provide the definition of the symbol at the given position and document. */ provideDefinition(model: model.ITextModel, position: Position, token: CancellationToken): DefinitionLink | Thenable<DefinitionLink[]>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The implementation provider interface defines the contract between extensions and * the go to implementation feature. */ export interface ImplementationProvider { /** * Provide the implementation of the symbol at the given position and document. */ provideImplementation(model: model.ITextModel, position: Position, token: CancellationToken): Definition | Thenable<Definition>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The type definition provider interface defines the contract between extensions and * the go to type definition feature. */ export interface TypeDefinitionProvider { /** * Provide the type definition of the symbol at the given position and document. */ provideTypeDefinition(model: model.ITextModel, position: Position, token: CancellationToken): Definition | Thenable<Definition>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface DocumentSymbol { name: string; detail: string; kind: SymbolKind; containerName?: string; range: IRange; selectionRange: IRange; children?: DocumentSymbol[]; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The document symbol provider interface defines the contract between extensions and * the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_goto-symbol)-feature. */ export interface DocumentSymbolProvider { displayName?: string; /** * Provide symbol information for the given document. */ provideDocumentSymbols(model: model.ITextModel, token: CancellationToken): DocumentSymbol[] | Thenable<DocumentSymbol[]>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface TextEdit { range: IRange; text: string; eol?: model.EndOfLineSequence; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * Interface used to format a model */ export interface FormattingOptions { /** * Size of a tab in spaces. */ tabSize: number; /** * Prefer spaces over tabs. */ insertSpaces: boolean; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The document formatting provider interface defines the contract between extensions and * the formatting-feature. */ export interface DocumentFormattingEditProvider { /** * Provide formatting edits for a whole document. */ provideDocumentFormattingEdits(model: model.ITextModel, options: FormattingOptions, token: CancellationToken): TextEdit[] | Thenable<TextEdit[]>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The document formatting provider interface defines the contract between extensions and * the formatting-feature. */ export interface DocumentRangeFormattingEditProvider { /** * Provide formatting edits for a range in a document. * * The given range is a hint and providers can decide to format a smaller * or larger range. Often this is done by adjusting the start and end * of the range to full syntax nodes. */ provideDocumentRangeFormattingEdits(model: model.ITextModel, range: Range, options: FormattingOptions, token: CancellationToken): TextEdit[] | Thenable<TextEdit[]>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * The document formatting provider interface defines the contract between extensions and * the formatting-feature. */ export interface OnTypeFormattingEditProvider { autoFormatTriggerCharacters: string[]; /** * Provide formatting edits after a character has been typed. * * The given position and character should hint to the provider * what range the position to expand to, like find the matching `{` * when `}` has been entered. */ provideOnTypeFormattingEdits(model: model.ITextModel, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): TextEdit[] | Thenable<TextEdit[]>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface IInplaceReplaceSupportResult { value: string; range: IRange; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * A link inside the editor. */ export interface ILink { range: IRange; url?: string; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * A provider of links. */ export interface LinkProvider { provideLinks(model: model.ITextModel, token: CancellationToken): ILink[] | Thenable<ILink[]>; resolveLink?: (link: ILink, token: CancellationToken) => ILink | Thenable<ILink>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * A color in RGBA format. */ export interface IColor { /** * The red component in the range [0-1]. */ readonly red: number; /** * The green component in the range [0-1]. */ readonly green: number; /** * The blue component in the range [0-1]. */ readonly blue: number; /** * The alpha component in the range [0-1]. */ readonly alpha: number; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * String representations for a color */ export interface IColorPresentation { /** * The label of this color presentation. It will be shown on the color * picker header. By default this is also the text that is inserted when selecting * this color presentation. */ label: string; /** * An [edit](#TextEdit) which is applied to a document when selecting * this presentation for the color. */ textEdit?: TextEdit; /** * An optional array of additional [text edits](#TextEdit) that are applied when * selecting this color presentation. */ additionalTextEdits?: TextEdit[]; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * A color range is a range in a text model which represents a color. */ export interface IColorInformation { /** * The range within the model. */ range: IRange; /** * The color represented in this range. */ color: IColor; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * A provider of colors for editor models. */ export interface DocumentColorProvider { /** * Provides the color ranges for a specific model. */ provideDocumentColors(model: model.ITextModel, token: CancellationToken): IColorInformation[] | Thenable<IColorInformation[]>; /** * Provide the string representations for a color. */ provideColorPresentations(model: model.ITextModel, colorInfo: IColorInformation, token: CancellationToken): IColorPresentation[] | Thenable<IColorPresentation[]>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface FoldingContext { }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * A provider of colors for editor models. */ export interface FoldingRangeProvider { /** * Provides the color ranges for a specific model. */ provideFoldingRanges(model: model.ITextModel, context: FoldingContext, token: CancellationToken): FoldingRange[] | Thenable<FoldingRange[]>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface FoldingRange { /** * The zero-based start line of the range to fold. The folded area starts after the line's last character. */ start: number; /** * The zero-based end line of the range to fold. The folded area ends with the line's last character. */ end: number; /** * Describes the [Kind](#FoldingRangeKind) of the folding range such as [Comment](#FoldingRangeKind.Comment) or * [Region](#FoldingRangeKind.Region). The kind is used to categorize folding ranges and used by commands * like 'Fold all comments'. See * [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds. */ kind?: FoldingRangeKind; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface ResourceFileEdit { oldUri: URI; newUri: URI; options: { overwrite?: boolean, ignoreIfExists?: boolean }; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface ResourceTextEdit { resource: URI; modelVersionId?: number; edits: TextEdit[]; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface WorkspaceEdit { edits: Array<ResourceTextEdit | ResourceFileEdit>; rejectReason?: string; // TODO@joh, move to rename }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface RenameLocation { range: IRange; text: string; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface RenameProvider { provideRenameEdits(model: model.ITextModel, position: Position, newName: string, token: CancellationToken): WorkspaceEdit | Thenable<WorkspaceEdit>; resolveRenameLocation?(model: model.ITextModel, position: Position, token: CancellationToken): RenameLocation | Thenable<RenameLocation>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface Command { id: string; title: string; tooltip?: string; arguments?: any[]; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface CommentInfo { owner: number; threads: CommentThread[]; commentingRanges?: IRange[]; reply?: Command; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface CommentThread { threadId: string; resource: string; range: IRange; comments: Comment[]; collapsibleState?: CommentThreadCollapsibleState; reply?: Command; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface NewCommentAction { ranges: IRange[]; actions: Command[]; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface Comment { readonly commentId: string; readonly body: IMarkdownString; readonly userName: string; readonly gravatar: string; readonly command?: Command; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface CommentThreadChangedEvent { readonly owner: number; /** * Added comment threads. */ readonly added: CommentThread[]; /** * Removed comment threads. */ readonly removed: CommentThread[]; /** * Changed comment threads. */ readonly changed: CommentThread[]; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface DocumentCommentProvider { provideDocumentComments(resource: URI, token: CancellationToken): Promise<CommentInfo>; createNewCommentThread(resource: URI, range: Range, text: string, token: CancellationToken): Promise<CommentThread>; replyToCommentThread(resource: URI, range: Range, thread: CommentThread, text: string, token: CancellationToken): Promise<CommentThread>; onDidChangeCommentThreads(): Event<CommentThreadChangedEvent>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface WorkspaceCommentProvider { provideWorkspaceComments(token: CancellationToken): Promise<CommentThread[]>; createNewCommentThread(resource: URI, range: Range, text: string, token: CancellationToken): Promise<CommentThread>; replyToCommentThread(resource: URI, range: Range, thread: CommentThread, text: string, token: CancellationToken): Promise<CommentThread>; onDidChangeCommentThreads(): Event<CommentThreadChangedEvent>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface ICodeLensSymbol { range: IRange; id?: string; command?: Command; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface CodeLensProvider { onDidChange?: Event<this>; provideCodeLenses(model: model.ITextModel, token: CancellationToken): ICodeLensSymbol[] | Thenable<ICodeLensSymbol[]>; resolveCodeLens?(model: model.ITextModel, codeLens: ICodeLensSymbol, token: CancellationToken): ICodeLensSymbol | Thenable<ICodeLensSymbol>; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface ITokenizationSupportChangedEvent { changedLanguages: string[]; changedColorMap: boolean; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface ITokenizationRegistry { /** * An event triggered when: * - a tokenization support is registered, unregistered or changed. * - the color map is changed. */ onDidChange: Event<ITokenizationSupportChangedEvent>; /** * Fire a change event for a language. * This is useful for languages that embed other languages. */ fire(languages: string[]): void; /** * Register a tokenization support. */ register(language: string, support: ITokenizationSupport): IDisposable; /** * Get the tokenization support for a language. * Returns null if not found. */ get(language: string): ITokenizationSupport; /** * Set the new color map that all tokens will use in their ColorId binary encoded bits for foreground and background. */ setColorMap(colorMap: Color[]): void; getColorMap(): Color[]; getDefaultBackground(): Color; }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * Open ended enum at runtime * @internal */ export const enum LanguageId { Null = 0, PlainText = 1 }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * A font style. Values are 2^x such that a bit mask can be used. * @internal */ export const enum FontStyle { NotSet = -1, None = 0, Italic = 1, Bold = 2, Underline = 4 }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * Open ended enum at runtime * @internal */ export const enum ColorId { None = 0, DefaultForeground = 1, DefaultBackground = 2 }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * A standard token type. Values are 2^x such that a bit mask can be used. * @internal */ export const enum StandardTokenType { Other = 0, Comment = 1, String = 2, RegEx = 4 }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * Helpers to manage the "collapsed" metadata of an entire StackElement stack. * The following assumptions have been made: * - languageId < 256 => needs 8 bits * - unique color count < 512 => needs 9 bits * * The binary format is: * - ------------------------------------------- * 3322 2222 2222 1111 1111 1100 0000 0000 * 1098 7654 3210 9876 5432 1098 7654 3210 * - ------------------------------------------- * xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx * bbbb bbbb bfff ffff ffFF FTTT LLLL LLLL * - ------------------------------------------- * - L = LanguageId (8 bits) * - T = StandardTokenType (3 bits) * - F = FontStyle (3 bits) * - f = foreground color (9 bits) * - b = background color (9 bits) * * @internal */ export const enum MetadataConsts { LANGUAGEID_MASK = 0b00000000000000000000000011111111, TOKEN_TYPE_MASK = 0b00000000000000000000011100000000, FONT_STYLE_MASK = 0b00000000000000000011100000000000, FOREGROUND_MASK = 0b00000000011111111100000000000000, BACKGROUND_MASK = 0b11111111100000000000000000000000, LANGUAGEID_OFFSET = 0, TOKEN_TYPE_OFFSET = 8, FONT_STYLE_OFFSET = 11, FOREGROUND_OFFSET = 14, BACKGROUND_OFFSET = 23 }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * How a suggest provider was triggered. */ export enum SuggestTriggerKind { Invoke = 0, TriggerCharacter = 1, TriggerForIncompleteCompletions = 2 }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * @internal */ export enum CodeActionTrigger { Automatic = 1, Manual = 2, }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * A document highlight kind. */ export enum DocumentHighlightKind { /** * A textual occurrence. */ Text, /** * Read-access of a symbol, like reading a variable. */ Read, /** * Write-access of a symbol, like writing to a variable. */ Write }
Hawkbat/vscode
src/vs/editor/common/modes.ts
TypeScript