type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
InterfaceDeclaration
/** * @internal */ export interface CommentInfo { extensionId: string; threads: CommentThread[]; commentingRanges?: IRange[]; reply?: Command; draftMode: DraftMode; }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface CommentThread { extensionId: string; threadId: string; resource: string; range: IRange; comments: Comment[]; collapsibleState?: CommentThreadCollapsibleState; reply?: Command; }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface NewCommentAction { ranges: IRange[]; actions: Command[]; }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface Comment { readonly commentId: string; readonly body: IMarkdownString; readonly userName: string; readonly userIconPath: string; readonly canEdit?: boolean; readonly canDelete?: boolean; readonly command?: Command; readonly isDraft?: boolean; }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface CommentThreadChangedEvent { /** * Added comment threads. */ readonly added: CommentThread[]; /** * Removed comment threads. */ readonly removed: CommentThread[]; /** * Changed comment threads. */ readonly changed: CommentThread[]; /** * changed draft mode. */ readonly draftMode: DraftMode; }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ 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>; editComment(resource: URI, comment: Comment, text: string, token: CancellationToken): Promise<void>; deleteComment(resource: URI, comment: Comment, token: CancellationToken): Promise<void>; startDraft?(resource: URI, token: CancellationToken): Promise<void>; deleteDraft?(resource: URI, token: CancellationToken): Promise<void>; finishDraft?(resource: URI, token: CancellationToken): Promise<void>; startDraftLabel?: string; deleteDraftLabel?: string; finishDraftLabel?: string; onDidChangeCommentThreads(): Event<CommentThreadChangedEvent>; }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
/** * @internal */ export interface WorkspaceCommentProvider { provideWorkspaceComments(token: CancellationToken): Promise<CommentThread[]>; onDidChangeCommentThreads(): Event<CommentThreadChangedEvent>; }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
export interface CodeLensProvider { onDidChange?: Event<this>; provideCodeLenses(model: model.ITextModel, token: CancellationToken): ProviderResult<ICodeLensSymbol[]>; resolveCodeLens?(model: model.ITextModel, codeLens: ICodeLensSymbol, token: CancellationToken): ProviderResult<ICodeLensSymbol>; }
brasten/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; /** * Register a promise for a tokenization support. */ registerPromise(language: string, promise: Thenable<ITokenizationSupport>): IDisposable; /** * Get the tokenization support for a language. * Returns null if not found. */ get(language: string): ITokenizationSupport; /** * Get the promise of a tokenization support for a language. * `null` is returned if no support is available and no promise for the support has been registered yet. */ getPromise(language: string): Thenable<ITokenizationSupport> | null; /** * 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[] | null; getDefaultBackground(): Color | null; }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
export const enum CompletionItemKind { Method, Function, Constructor, Field, Variable, Class, Struct, Interface, Module, Property, Event, Operator, Unit, Value, Constant, Enum, EnumMember, Keyword, Text, Color, File, Reference, Customcolor, Folder, TypeParameter, Snippet, // <- highest value (used for compare!) }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
export const enum CompletionItemInsertTextRule { /** * Adjust whitespace/indentation of multiline insert texts to * match the current line indentation. */ KeepWhitespace = 0b001, /** * `insertText` is a snippet. */ InsertAsSnippet = 0b100, }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * How a suggest provider was triggered. */ export const enum CompletionTriggerKind { Invoke = 0, TriggerCharacter = 1, TriggerForIncompleteCompletions = 2 }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * @internal */ export const enum CodeActionTrigger { Automatic = 1, Manual = 2, }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
export enum SignatureHelpTriggerKind { Invoke = 1, TriggerCharacter = 2, ContentChange = 3, }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * A symbol kind. */ export const enum SymbolKind { File = 0, Module = 1, Namespace = 2, Package = 3, Class = 4, Method = 5, Property = 6, Field = 7, Constructor = 8, Enum = 9, Interface = 10, Function = 11, Variable = 12, Constant = 13, String = 14, Number = 15, Boolean = 16, Array = 17, Object = 18, Key = 19, Null = 20, EnumMember = 21, Struct = 22, Event = 23, Operator = 24, TypeParameter = 25 }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * @internal */ export enum DraftMode { NotSupported, InDraft, NotInDraft }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
EnumDeclaration
/** * @internal */ export enum CommentThreadCollapsibleState { /** * Determines an item is collapsed */ Collapsed = 0, /** * Determines an item is expanded */ Expanded = 1 }
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
TypeAliasDeclaration
/** * A provider result represents the values a provider, like the [`HoverProvider`](#HoverProvider), * may return. For once this is the actual result type `T`, like `Hover`, or a thenable that resolves * to that type `T`. In addition, `null` and `undefined` can be returned - either directly or from a * thenable. */ export type ProviderResult<T> = T | undefined | null | Thenable<T | undefined | null>;
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
TypeAliasDeclaration
export type Definition = Location | Location[] | LocationLink[];
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
TypeAliasDeclaration
export type TextEdit = { range: IRange; text: string; eol?: model.EndOfLineSequence; };
brasten/vscode
src/vs/editor/common/modes.ts
TypeScript
InterfaceDeclaration
interface e
tauruscrypto/taurus
src/qt/locale/bitcoin_gl.ts
TypeScript
ArrowFunction
({ icon }) => ({ fillRule: 'evenodd', clipRule: 'evenodd', d: icon.svgPathData, })
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
ArrowFunction
({ type = 'checkbox' }) => ({ type, })
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
ArrowFunction
({ theme, iconSize }) => parseFloat(theme.clickbound.height) / iconSize
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
ArrowFunction
({ disabled }) => (disabled ? 'not-allowed' : 'pointer')
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
ArrowFunction
({ theme }) => outlineTemplate(theme.states.focus.outline)
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
ArrowFunction
({ height, width, fill }) => ({ name: null, xmlns: 'http://www.w3.org/2000/svg', height, width, fill, })
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
ArrowFunction
({ theme }) => spacingsTemplate(theme.spacings)
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
ArrowFunction
({ disabled }) => disabled ? 'transparent' : tokens.states.hover.background
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
TypeAliasDeclaration
type StyledIconPathProps = { icon: IconData name: string }
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
TypeAliasDeclaration
type StyledInputProps = { iconSize: number }
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
TypeAliasDeclaration
type StyledInputWrapperProps = { disabled: boolean }
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
TypeAliasDeclaration
export type InputProps = { /** If true, the checkbox will be disabled */ disabled?: boolean /** If true, the checkbox appears indeterminate. Important! You'll have to * set the native element to indeterminate yourself. */ indeterminate?: boolean } & Omit<InputHTMLAttributes<HTMLInputElement>, 'disabled'> & { ref?: Ref<HTMLInputElement> }
equinor/design-system
packages/eds-core-react/src/components/Checkbox/Input.tsx
TypeScript
ArrowFunction
({ namespace, noProjectsAvailable, }) => { const [applicationsAvailable, setApplicationsAvailable] = React.useState(true); const projectsAvailable = !noProjectsAvailable; const [selectedKey, { touched, error }] = useField('application.selectedKey'); const { setFieldValue, setFieldTouched, validateForm } = useFormikContext<FormikValues>(); const fieldId = getFieldId('application-name', 'dropdown'); const isValid = !(touched && error); const errorMessage = !isValid ? error : ''; const onDropdownChange = (key: string, application: string) => { setFieldTouched('application.selectedKey', true); setFieldValue('application.name', sanitizeApplicationValue(application, key)); setFieldValue('application.selectedKey', key); validateForm(); }; const handleOnLoad = (applicationList: { [key: string]: string }) => { const noApplicationsAvailable = _.isEmpty(applicationList); setApplicationsAvailable(!noApplicationsAvailable); if (noApplicationsAvailable) { setFieldValue('application.selectedKey', ''); setFieldValue('application.name', ''); } }; const actionItems = [ { actionTitle: 'Create Application', actionKey: CREATE_APPLICATION_KEY, }, { actionTitle: 'Unassigned', actionKey: UNASSIGNED_KEY, }, ]; return ( <> {projectsAvailable && applicationsAvailable && ( <FormGroup fieldId={fieldId} label="Application" helperTextInvalid={errorMessage} isValid={isValid} helperText="Select an application for your grouping or Unassigned to not use an application grouping." > <ApplicationDropdown dropDownClassName="dropdown--full-width" menuClassName="dropdown-menu--text-wrap" id={fieldId} namespace={namespace} actionItems={actionItems} autoSelect selectedKey={selectedKey.value} onChange={onDropdownChange} onLoad={handleOnLoad} /> </FormGroup>
bobcallaway/console
frontend/packages/dev-console/src/components/import/app/ApplicationSelector.tsx
TypeScript
ArrowFunction
(key: string, application: string) => { setFieldTouched('application.selectedKey', true); setFieldValue('application.name', sanitizeApplicationValue(application, key)); setFieldValue('application.selectedKey', key); validateForm(); }
bobcallaway/console
frontend/packages/dev-console/src/components/import/app/ApplicationSelector.tsx
TypeScript
ArrowFunction
(applicationList: { [key: string]: string }) => { const noApplicationsAvailable = _.isEmpty(applicationList); setApplicationsAvailable(!noApplicationsAvailable); if (noApplicationsAvailable) { setFieldValue('application.selectedKey', ''); setFieldValue('application.name', ''); } }
bobcallaway/console
frontend/packages/dev-console/src/components/import/app/ApplicationSelector.tsx
TypeScript
InterfaceDeclaration
export interface ApplicationSelectorProps { namespace?: string; noProjectsAvailable?: boolean; }
bobcallaway/console
frontend/packages/dev-console/src/components/import/app/ApplicationSelector.tsx
TypeScript
ArrowFunction
() => { const router = useRouter(); const id = getId(router.query) || -1; const { loading, error, data } = useChapterQuery({ variables: { id } }); if (loading || error || !data?.chapter) { return ( <Layout> <h1>{loading ? 'Loading...' : 'Error...'}</h1> {error && <div className={styles.error}>{error}</div>} </Layout>
BearerPipelineTest/chapter
client/src/modules/dashboard/Chapters/pages/ChapterPage.tsx
TypeScript
InterfaceDeclaration
/** * The context used by the encoding process. */ export interface EncodeContext { /** * Encodes the given input. For entities, it will recursively encode them, add * them to the final output as a side-effect, and return a reference. For other * values, it will return them as-is or encode them, usually as a string. * @param value */ encode(value: any): SzrLeaf; /** * Sets the metadata for this entity. The metadata can be any JSON-legal value, * including an object. It doesn't do anything, but can be accessed while decoding. */ metadata: any; }
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
InterfaceDeclaration
/** * The context used by the create stage of the decoding process. Only * exposes the entity's metadata. */ export interface DecodeCreateContext { // The metadata for this encoded entity. metadata: any; }
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
InterfaceDeclaration
/** * The context used by the init stage of the decoding process. Allows * resolving references to other entities. */ export interface DecodeInitContext extends DecodeCreateContext { // Resolves references and decodes encoded scalars. This isn't a recursive call. decode(value: SzrLeaf): any; }
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
InterfaceDeclaration
/** * The decoding logic for a prototype encoding. */ export interface Decoder { // Creates an instance of the entity without referencing any other encoded entities. create(encoded: SzrEncodedEntity, ctx: DecodeCreateContext): any; // Fills in additional data by resolving references to other entities. init?(target: any, encoded: SzrEncodedEntity, ctx: DecodeInitContext): void; }
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
InterfaceDeclaration
/** * Specifies a prototype encoding. Missing fields will be filled in automatically. */ export interface SzrPrototypeSpecifier { // The key of the encoding. Must be unique. Will be inferred from the prototype if missing. key?: string; // The prototype. Required. prototype: object | null; // The decoding logic. If missing, the default decoding will be used, which will fill in // the object's properties and attach the correct prototype. decoder?: Decoder; // The encoding logic. If missing, the default encode function will be used, which // will iterate over the object's own enumerable properties and recursively encode them. encode?(input: any, ctx: EncodeContext): SzrEncodedEntity; }
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
InterfaceDeclaration
/** * A full symbol encoding. Mainly for internal use. */ export interface SzrSymbolEncoding { key: string; symbol: symbol; metadata?: any; }
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
InterfaceDeclaration
/** * A full prototype encoding. Mainly for internal use. */ export interface SzrPrototypeEncoding { key: string; prototypes: object[]; decoder: Decoder; encode(input: any, ctx: EncodeContext): any; }
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
InterfaceDeclaration
export interface SzrConfig { /** * An array of encoding specifiers. If you put your constructors and symbols here, * the Szr will recognize them. */ encodings: SzrEncodingSpecifier[]; unsupported: Function[]; }
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
TypeAliasDeclaration
/** * A full szr encoding. Mainly for internal use. */ export type SzrEncoding = SzrPrototypeEncoding | SzrSymbolEncoding;
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
TypeAliasDeclaration
/** * An encoding specifier. Can be a symbol or constructor for a shorthand * symbol or prototype encoding. You can also give symbol or prototype encoding specifier * if you want to be more explicit. */ export type SzrEncodingSpecifier = symbol | Function | SzrPrototypeSpecifier | SzrPrototypeEncoding | SzrSymbolEncoding;
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
TypeAliasDeclaration
export type DeepPartial<T> = { [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K] };
GregRos/szr
src/lib/internal/szr-interface.ts
TypeScript
ArrowFunction
a => a.name === CORE_MODULE
0gajun/aws-cdk
tools/awslint/lib/rules/core-types.ts
TypeScript
ClassDeclaration
export class CoreTypes { /** * @returns true if assembly has the Core module */ public static hasCoreModule(assembly: reflect.Assembly) { return (!assembly.system.assemblies.find(a => a.name === CORE_MODULE)); } /** * @returns true if `classType` represents an L1 Cfn Resource */ public static isCfnResource(c: reflect.ClassType) { if (!c.system.includesAssembly(CORE_MODULE)) { return false; } // skip CfnResource itself if (c.fqn === CoreTypesFqn.CfnResource) { return false; } if (!this.isConstructClass(c)) { return false; } const cfnResourceClass = c.system.findFqn(CoreTypesFqn.CfnResource); if (!c.extends(cfnResourceClass)) { return false; } if (!c.name.startsWith("Cfn")) { return false; } return true; } /** * @returns true if `classType` represents a Construct */ public static isConstructClass(c: reflect.ClassType) { if (!c.system.includesAssembly(CORE_MODULE)) { return false; } if (!c.isClassType()) { return false; } if (c.abstract) { return false; } return c.extends(c.system.findFqn(CoreTypesFqn.Construct)); } /** * @returns true if `classType` represents an AWS resource (i.e. extends `cdk.Resource`). */ public static isResourceClass(classType: reflect.ClassType) { const baseResource = classType.system.findClass(CoreTypesFqn.Resource); return classType.extends(baseResource) || getDocTag(classType, "resource"); } /** * Return true if the given interface type is a CFN class or prop type */ public static isCfnType(interfaceType: reflect.Type) { return interfaceType.name.startsWith('Cfn') || (interfaceType.namespace && interfaceType.namespace.startsWith('Cfn')); } /** * @returns `classType` for the core type Construct */ public get constructClass() { return this.sys.findClass(CoreTypesFqn.Construct); } /** * @returns `interfacetype` for the core type Construct */ public get constructInterface() { return this.sys.findInterface(CoreTypesFqn.ConstructInterface); } /** * @returns `classType` for the core type Construct */ public get resourceClass() { return this.sys.findClass(CoreTypesFqn.Resource); } /** * @returns `interfaceType` for the core type Resource */ public get resourceInterface() { return this.sys.findInterface(CoreTypesFqn.ResourceInterface); } /** * @returns `classType` for the core type Token */ public get tokenInterface() { return this.sys.findInterface(CoreTypesFqn.ResolvableInterface); } public get physicalNameClass() { return this.sys.findClass(CoreTypesFqn.PhysicalName) } private readonly sys: TypeSystem; constructor(sys: reflect.TypeSystem) { this.sys = sys; if (!sys.includesAssembly(CORE_MODULE)) { // disable-all-checks return; } for (const fqn of Object.values(CoreTypesFqn)) { if (!this.sys.tryFindFqn(fqn)) { throw new Error(`core FQN type not found: ${fqn}`); } } } }
0gajun/aws-cdk
tools/awslint/lib/rules/core-types.ts
TypeScript
EnumDeclaration
enum CoreTypesFqn { CfnResource = "@aws-cdk/core.CfnResource", Construct = "@aws-cdk/core.Construct", ConstructInterface = "@aws-cdk/core.IConstruct", Resource = "@aws-cdk/core.Resource", ResourceInterface = "@aws-cdk/core.IResource", ResolvableInterface = "@aws-cdk/core.IResolvable", PhysicalName = "@aws-cdk/core.PhysicalName" }
0gajun/aws-cdk
tools/awslint/lib/rules/core-types.ts
TypeScript
MethodDeclaration
/** * @returns true if assembly has the Core module */ public static hasCoreModule(assembly: reflect.Assembly) { return (!assembly.system.assemblies.find(a => a.name === CORE_MODULE)); }
0gajun/aws-cdk
tools/awslint/lib/rules/core-types.ts
TypeScript
MethodDeclaration
/** * @returns true if `classType` represents an L1 Cfn Resource */ public static isCfnResource(c: reflect.ClassType) { if (!c.system.includesAssembly(CORE_MODULE)) { return false; } // skip CfnResource itself if (c.fqn === CoreTypesFqn.CfnResource) { return false; } if (!this.isConstructClass(c)) { return false; } const cfnResourceClass = c.system.findFqn(CoreTypesFqn.CfnResource); if (!c.extends(cfnResourceClass)) { return false; } if (!c.name.startsWith("Cfn")) { return false; } return true; }
0gajun/aws-cdk
tools/awslint/lib/rules/core-types.ts
TypeScript
MethodDeclaration
/** * @returns true if `classType` represents a Construct */ public static isConstructClass(c: reflect.ClassType) { if (!c.system.includesAssembly(CORE_MODULE)) { return false; } if (!c.isClassType()) { return false; } if (c.abstract) { return false; } return c.extends(c.system.findFqn(CoreTypesFqn.Construct)); }
0gajun/aws-cdk
tools/awslint/lib/rules/core-types.ts
TypeScript
MethodDeclaration
/** * @returns true if `classType` represents an AWS resource (i.e. extends `cdk.Resource`). */ public static isResourceClass(classType: reflect.ClassType) { const baseResource = classType.system.findClass(CoreTypesFqn.Resource); return classType.extends(baseResource) || getDocTag(classType, "resource"); }
0gajun/aws-cdk
tools/awslint/lib/rules/core-types.ts
TypeScript
MethodDeclaration
/** * Return true if the given interface type is a CFN class or prop type */ public static isCfnType(interfaceType: reflect.Type) { return interfaceType.name.startsWith('Cfn') || (interfaceType.namespace && interfaceType.namespace.startsWith('Cfn')); }
0gajun/aws-cdk
tools/awslint/lib/rules/core-types.ts
TypeScript
ClassDeclaration
@Component({ templateUrl: './search-view.component.html', styleUrls: ['./search-view.component.scss'] }) export class SearchViewComponent extends SearchViewBaseComponent implements OnInit { selfRoute = ['search']; constructor( searchService: SearchService, bookmarkService: BookmarkLocalService, router: Router, route: ActivatedRoute, feedbackService: FeedbackService ) { super(searchService, bookmarkService, router, route, feedbackService); } ngOnInit() { this.ngOnInitBase(); } updateComponentSpecificUIState() { // nothing to do here } }
DOSSIER-dev/DOSSIER-Sources
src/app/sources-list/search-view/search-view.component.ts
TypeScript
MethodDeclaration
ngOnInit() { this.ngOnInitBase(); }
DOSSIER-dev/DOSSIER-Sources
src/app/sources-list/search-view/search-view.component.ts
TypeScript
MethodDeclaration
updateComponentSpecificUIState() { // nothing to do here }
DOSSIER-dev/DOSSIER-Sources
src/app/sources-list/search-view/search-view.component.ts
TypeScript
ClassDeclaration
export class SeoHelper { public static checkLength(editor: vscode.TextEditor, collection: vscode.DiagnosticCollection, article: matter.GrayMatterFile<string>, fieldName: string, length: number) { const value = article.data[fieldName]; if (value.length >= length) { const text = editor.document.getText(); const markdown = ArticleHelper.stringifyFrontMatter("", article.data); const txtIdx = text.indexOf(value); if (txtIdx !== -1 && txtIdx < markdown.length) { const posStart = editor.document.positionAt(txtIdx); const posEnd = editor.document.positionAt(txtIdx + 1 + value.length); const diagnostic: vscode.Diagnostic = { code: '', message: `Article ${fieldName} is longer than ${length} characters (current length: ${value.length}). For SEO reasons, it would be better to make it less than ${length} characters.`, range: new vscode.Range(posStart, posEnd), severity: vscode.DiagnosticSeverity.Warning, source: 'Front Matter' }; if (collection.has(editor.document.uri)) { const otherDiag = collection.get(editor.document.uri) || []; collection.set(editor.document.uri, [...otherDiag, diagnostic]); } else { collection.set(editor.document.uri, [diagnostic]); } } } } }
liusoon/vscode-front-matter
src/helpers/SeoHelper.ts
TypeScript
MethodDeclaration
public static checkLength(editor: vscode.TextEditor, collection: vscode.DiagnosticCollection, article: matter.GrayMatterFile<string>, fieldName: string, length: number) { const value = article.data[fieldName]; if (value.length >= length) { const text = editor.document.getText(); const markdown = ArticleHelper.stringifyFrontMatter("", article.data); const txtIdx = text.indexOf(value); if (txtIdx !== -1 && txtIdx < markdown.length) { const posStart = editor.document.positionAt(txtIdx); const posEnd = editor.document.positionAt(txtIdx + 1 + value.length); const diagnostic: vscode.Diagnostic = { code: '', message: `Article ${fieldName} is longer than ${length} characters (current length: ${value.length}). For SEO reasons, it would be better to make it less than ${length} characters.`, range: new vscode.Range(posStart, posEnd), severity: vscode.DiagnosticSeverity.Warning, source: 'Front Matter' }; if (collection.has(editor.document.uri)) { const otherDiag = collection.get(editor.document.uri) || []; collection.set(editor.document.uri, [...otherDiag, diagnostic]); } else { collection.set(editor.document.uri, [diagnostic]); } } } }
liusoon/vscode-front-matter
src/helpers/SeoHelper.ts
TypeScript
FunctionDeclaration
export function subscribe<GValue>( observable: IObservable<GValue>, observer: IObserver<GValue>, ): IUnsubscribe { return observable(observer); }
lifaon74/rx-js-light
src/misc/helpers/subscribe.ts
TypeScript
ClassDeclaration
@NgModule({ declarations: [ IonLoaderButtonComponent ], imports: [ BrowserModule, BrowserAnimationsModule, IonicModule.forRoot(IonLoaderButtonComponent) ], exports: [ IonLoaderButtonComponent ] }) export class IonLoaderButtonModule { }
souvikhazra1/ion-loader-button
src/ion-loader-button.module.ts
TypeScript
ArrowFunction
(initParams?: IInitAppParams, patterns?: IPattern[]):IInitialData => { console.log(patterns); let init:IInitAppParams = initParams ? initParams : {fixtures: 5, static: 5, dynamic: 5, long: 5}; const fixtures = generateMockFixtures(init.fixtures ? init.fixtures : 5 ); const patternsS = patterns ? patterns.filter(p => p.type === 'static') : generateMockPatterns(init.static ? init.static : 1, 'static', 0); const patternsD = patterns ? patterns.filter(p => p.type === 'dynamic') : generateMockPatterns(init.dynamic ? init.dynamic : 2, 'dynamic', init.dynamic); const patternsL = patterns ? patterns.filter(p => p.type === 'long') : generateMockPatterns(init.long ? init.long : 1, 'long', init.dynamic + init.long); return { fields: { cuesFields: generateFields(null), fireMachines: { staticFields: generateFields(patternsS), dynamicFields: generateFields(patternsD), longFields: generateFields(patternsL) }, fireWorks: { fields: generateFields(null) } }, fixtures: { patterns: { fireMachine: [...patternsS, ...patternsD, ...patternsL], fireWorks: [], dimmer: [] }, fixtures: fixtures, groups: [], fixtureTypes: ['fireMachine', 'fireWorks', 'dimmer'], shootingFixtures:[] }, cues: { selectedCue: null, cues: [], timelineCues: [], } }; }
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
p => p.type === 'static'
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
p => p.type === 'dynamic'
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
p => p.type === 'long'
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
(params?: IInitAppParams, patterns?: IPattern[]): IInitialData => { //dataStorage.set('showData', initialData); return getInitialState(params, patterns); }
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
(state: IInitialData) => { try { dataStorage.set('showData', state); } catch (e) { console.log(e) } }
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
(): IInitialData => { try { const commonData: IInitialData = dataStorage.get('showData'); return commonData; } catch (e) { //dataStorage.set('showData', initialData); return getInitialState(); } }
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
() => { try { return externalAPI.getPath() } catch (e) { return getInitialState(); } }
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
() => { try { return externalAPI.save() } catch (e) { return getInitialState(); } }
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
(steps: IPatternStep[]): TPatternType => { return steps.length > 3 ? 'dynamic' : steps[2].time > 6 ? 'long' : 'static' }
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
async (path: string) => { let data: IPattern[] = await dataStorage.parse(path); return data.map(p => ({...p, id: uuid(), type: getPType(p.steps)})) }
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
p => ({...p, id: uuid(), type: getPType(p.steps)})
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
InterfaceDeclaration
export interface IInitAppParams { fixtures: number, static: number, dynamic: number, long: number }
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
InterfaceDeclaration
export interface IInitialData { fields: IFieldsState fixtures: IFixturesState cues: ICuesState }
Olrioll/RootOnFire
src/renderer/store/getInitalState.ts
TypeScript
ArrowFunction
(props) => { const handleTabChange = (key: string) => { const { match } = props; const url = match.url === '/' ? '' : match.url; switch (key) { case 'role': history.push(`${url}/role`); break; case 'user': history.push(`${url}/user`); break; default: break; } }; const getTabKey = () => { const { match, location } = props; const url = match.path === '/' ? '' : match.path; const tabKey = location.pathname.replace(`${url}/`, ''); const paths = tabKey.split('/'); if (paths[0] && paths[0] !== '/') { return paths[0]; } return 'role'; }; return ( <PageContainer tabList={tabList} tabActiveKey={getTabKey()} onTabChange={handleTabChange} > <div className="zcy-content" > {props.children} </div> </PageContainer>
zcy-inc/idata
front-end/src/pages/authority/index.tsx
TypeScript
ArrowFunction
(key: string) => { const { match } = props; const url = match.url === '/' ? '' : match.url; switch (key) { case 'role': history.push(`${url}/role`); break; case 'user': history.push(`${url}/user`); break; default: break; } }
zcy-inc/idata
front-end/src/pages/authority/index.tsx
TypeScript
ArrowFunction
() => { const { match, location } = props; const url = match.path === '/' ? '' : match.path; const tabKey = location.pathname.replace(`${url}/`, ''); const paths = tabKey.split('/'); if (paths[0] && paths[0] !== '/') { return paths[0]; } return 'role'; }
zcy-inc/idata
front-end/src/pages/authority/index.tsx
TypeScript
TypeAliasDeclaration
type TAuthorityProps = { match: { url: string; path: string; }; location: { pathname: string; }; };
zcy-inc/idata
front-end/src/pages/authority/index.tsx
TypeScript
MethodDeclaration
getTabKey()
zcy-inc/idata
front-end/src/pages/authority/index.tsx
TypeScript
ArrowFunction
val => { this.race = val; }
villematti/racewknd-timer
src/app/classes/classes.component.ts
TypeScript
ArrowFunction
response => { this.classes = JSON.parse(response.content); }
villematti/racewknd-timer
src/app/classes/classes.component.ts
TypeScript
ClassDeclaration
@Component({ selector: "ClassesComponent", moduleId: module.id, templateUrl: "./classes.component.html", styleUrls: ["./../app.component.css"] }) export class ClassesComponent { race: any = {}; classes = []; constructor( private router: Router, private api: ApiService, private activatedRoute: ActivatedRoute, private location: Location ) { this.activatedRoute.queryParams.subscribe(val => { this.race = val; }).unsubscribe(); } ngAfterViewInit(): void { this.getClasses(); } getClasses() { this.api.get$(Constants.GET_CLASSES).subscribe(response => { this.classes = JSON.parse(response.content); }) } onItemTap(event: any) { const params = { queryParams: { class: this.classes[event.index].id, race: JSON.stringify(this.race) } } this.router.navigate(["starts"], params); } onBack() { this.location.back(); } }
villematti/racewknd-timer
src/app/classes/classes.component.ts
TypeScript
MethodDeclaration
ngAfterViewInit(): void { this.getClasses(); }
villematti/racewknd-timer
src/app/classes/classes.component.ts
TypeScript
MethodDeclaration
getClasses() { this.api.get$(Constants.GET_CLASSES).subscribe(response => { this.classes = JSON.parse(response.content); }) }
villematti/racewknd-timer
src/app/classes/classes.component.ts
TypeScript
MethodDeclaration
onItemTap(event: any) { const params = { queryParams: { class: this.classes[event.index].id, race: JSON.stringify(this.race) } } this.router.navigate(["starts"], params); }
villematti/racewknd-timer
src/app/classes/classes.component.ts
TypeScript
MethodDeclaration
onBack() { this.location.back(); }
villematti/racewknd-timer
src/app/classes/classes.component.ts
TypeScript
InterfaceDeclaration
/** * Fields that uniquely identify a configuration setting */ export interface ConfigurationSettingId { /** * The key for this setting */ key: string; /** * The label for this setting. Leaving this undefined means this * setting does not have a label. */ label?: string; /** * The etag for this setting */ etag?: string; }
coolwine/azure-sdk-for-js
sdk/appconfiguration/app-configuration/src/models.ts
TypeScript
InterfaceDeclaration
/** * Necessary fields for updating or creating a new configuration setting */ export interface ConfigurationSettingParam extends ConfigurationSettingId { /** * The content type of the setting's value */ contentType?: string; /** * The setting's value */ value?: string; /** * Tags for this key */ tags?: { [propertyName: string]: string }; }
coolwine/azure-sdk-for-js
sdk/appconfiguration/app-configuration/src/models.ts
TypeScript
InterfaceDeclaration
/** * Configuration setting with extra metadata from the server, indicating * its etag, whether it is currently readonly and when it was last modified. */ export interface ConfigurationSetting extends ConfigurationSettingParam { /** * Whether or not the setting is read-only */ locked?: boolean; /** * The date when this setting was last modified */ lastModified?: Date; }
coolwine/azure-sdk-for-js
sdk/appconfiguration/app-configuration/src/models.ts
TypeScript
InterfaceDeclaration
/** * Fields that are hoisted up from the _response field of the object * Used in cases where individual HTTP response fields are important for * the user to use in common-use cases like handling http status codes 204 or 304. */ export interface HttpResponseFields { /** * The HTTP status code for the response */ statusCode: number; }
coolwine/azure-sdk-for-js
sdk/appconfiguration/app-configuration/src/models.ts
TypeScript
InterfaceDeclaration
/** * Parameters for adding a new configuration setting */ export interface AddConfigurationSettingParam extends ConfigurationSettingParam {}
coolwine/azure-sdk-for-js
sdk/appconfiguration/app-configuration/src/models.ts
TypeScript
InterfaceDeclaration
/** * Parameters for creating or updating a new configuration setting */ export interface SetConfigurationSettingParam extends ConfigurationSettingParam {}
coolwine/azure-sdk-for-js
sdk/appconfiguration/app-configuration/src/models.ts
TypeScript
InterfaceDeclaration
/** * HTTP response related information - headers and raw body. */ export interface HttpResponseField<HeadersT> { /** * The underlying HTTP response. */ _response: HttpResponse & { /** * The parsed HTTP response headers. */ parsedHeaders: HeadersT; /** * The response body as text (string format) */ bodyAsText: string; }; }
coolwine/azure-sdk-for-js
sdk/appconfiguration/app-configuration/src/models.ts
TypeScript
InterfaceDeclaration
/** * Options used to provide if-match or if-none-match headers for an HTTP request */ export interface HttpConditionalFields { /** * Used to perform an operation only if the targeted resource's etag matches the value provided. */ onlyIfUnchanged?: boolean; /** * Used to perform an operation only if the targeted resource's etag does not match the value * provided. */ onlyIfChanged?: boolean; }
coolwine/azure-sdk-for-js
sdk/appconfiguration/app-configuration/src/models.ts
TypeScript
InterfaceDeclaration
/** * Used when the API supports selectively returning fields. */ export interface OptionalFields { /** * Which fields to return for each ConfigurationSetting */ fields?: (keyof ConfigurationSetting)[]; }
coolwine/azure-sdk-for-js
sdk/appconfiguration/app-configuration/src/models.ts
TypeScript
InterfaceDeclaration
/** * Sync token header field */ export interface SyncTokenHeaderField { /** * Enables real-time consistency between requests by providing the returned value in the next * request made to the server. */ syncToken?: string; }
coolwine/azure-sdk-for-js
sdk/appconfiguration/app-configuration/src/models.ts
TypeScript