type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
---|---|---|---|---|
ArrowFunction |
([
plugin,
{
cpuTimeDelta,
cpuTimeTotal,
messageCountDelta,
messageCountTotal,
maxTime,
},
]) => ({
plugin,
cpuTimeTotal,
messageCountTotal,
cpuTimeDelta,
messageCountDelta,
maxTime,
}) | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
TypeAliasDeclaration |
type StatEntry = {
cpuTimeTotal: number; // Total time spend in persisted Reducer
cpuTimeDelta: number; // Time spend since previous tracking tick
messageCountTotal: number; // amount of message received for this plugin
messageCountDelta: number; // amout of messages received since previous tracking tick
maxTime: number; // maximum time spend in a single reducer call
}; | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
ArrowFunction |
() => {
let effects: ShelvesWithBookEffects;
let api: BookcaseStatisticsApi;
let actions$: Observable<Action> = new Observable<Action>();
let scheduler: TestScheduler;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
HttpClientModule,
ApiModule
],
providers: [
provideMockActions(() => actions$),
provideMockStore<ShelvesWithBook>(),
ShelvesWithBookEffects,
ErrorActions,
ErrorsFacade,
MesssagesFacade
]
});
effects = TestBed.get(ShelvesWithBookEffects);
api = TestBed.get(BookcaseStatisticsApi);
scheduler = new TestScheduler((a, e) => {
expect(a).toEqual(e);
});
});
describe('SELECT_SHELVES_WITH_BOOK$', () => {
it('it should assign FETCH_SHELVES_WITH_BOOK when api call was successfull', () => {
scheduler.run(({ hot, cold, expectObservable }) => {
const action = fromActions.SELECT_SHELVES_WITH_BOOK({ payload: { bookId: 1, query: DEFAULT_QUERY() } });
const pageResult: PageResult = {
items: [],
page: 0,
pagesCount: 0,
totalItems: 0
};
spyOn(api, 'getShelvesWithBook').and.returnValue(of(pageResult));
actions$ = hot('a', { a: action });
const completion = fromActions.FETCH_SHELVES_WITH_BOOK({ payload: { statistics: pageResult } });
expectObservable(effects.selectShelvesWithBook$)
.toBe('b', { b: completion });
});
});
});
} | kamilk08/BookLoversClient | src/app/modules/bookcases/bookcase-statistics/store/tests/shelves-with-book.effects.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
imports: [
HttpClientModule,
ApiModule
],
providers: [
provideMockActions(() => actions$),
provideMockStore<ShelvesWithBook>(),
ShelvesWithBookEffects,
ErrorActions,
ErrorsFacade,
MesssagesFacade
]
});
effects = TestBed.get(ShelvesWithBookEffects);
api = TestBed.get(BookcaseStatisticsApi);
scheduler = new TestScheduler((a, e) => {
expect(a).toEqual(e);
});
} | kamilk08/BookLoversClient | src/app/modules/bookcases/bookcase-statistics/store/tests/shelves-with-book.effects.spec.ts | TypeScript |
ArrowFunction |
() => actions$ | kamilk08/BookLoversClient | src/app/modules/bookcases/bookcase-statistics/store/tests/shelves-with-book.effects.spec.ts | TypeScript |
ArrowFunction |
(a, e) => {
expect(a).toEqual(e);
} | kamilk08/BookLoversClient | src/app/modules/bookcases/bookcase-statistics/store/tests/shelves-with-book.effects.spec.ts | TypeScript |
ArrowFunction |
() => {
it('it should assign FETCH_SHELVES_WITH_BOOK when api call was successfull', () => {
scheduler.run(({ hot, cold, expectObservable }) => {
const action = fromActions.SELECT_SHELVES_WITH_BOOK({ payload: { bookId: 1, query: DEFAULT_QUERY() } });
const pageResult: PageResult = {
items: [],
page: 0,
pagesCount: 0,
totalItems: 0
};
spyOn(api, 'getShelvesWithBook').and.returnValue(of(pageResult));
actions$ = hot('a', { a: action });
const completion = fromActions.FETCH_SHELVES_WITH_BOOK({ payload: { statistics: pageResult } });
expectObservable(effects.selectShelvesWithBook$)
.toBe('b', { b: completion });
});
});
} | kamilk08/BookLoversClient | src/app/modules/bookcases/bookcase-statistics/store/tests/shelves-with-book.effects.spec.ts | TypeScript |
ArrowFunction |
() => {
scheduler.run(({ hot, cold, expectObservable }) => {
const action = fromActions.SELECT_SHELVES_WITH_BOOK({ payload: { bookId: 1, query: DEFAULT_QUERY() } });
const pageResult: PageResult = {
items: [],
page: 0,
pagesCount: 0,
totalItems: 0
};
spyOn(api, 'getShelvesWithBook').and.returnValue(of(pageResult));
actions$ = hot('a', { a: action });
const completion = fromActions.FETCH_SHELVES_WITH_BOOK({ payload: { statistics: pageResult } });
expectObservable(effects.selectShelvesWithBook$)
.toBe('b', { b: completion });
});
} | kamilk08/BookLoversClient | src/app/modules/bookcases/bookcase-statistics/store/tests/shelves-with-book.effects.spec.ts | TypeScript |
ArrowFunction |
({ hot, cold, expectObservable }) => {
const action = fromActions.SELECT_SHELVES_WITH_BOOK({ payload: { bookId: 1, query: DEFAULT_QUERY() } });
const pageResult: PageResult = {
items: [],
page: 0,
pagesCount: 0,
totalItems: 0
};
spyOn(api, 'getShelvesWithBook').and.returnValue(of(pageResult));
actions$ = hot('a', { a: action });
const completion = fromActions.FETCH_SHELVES_WITH_BOOK({ payload: { statistics: pageResult } });
expectObservable(effects.selectShelvesWithBook$)
.toBe('b', { b: completion });
} | kamilk08/BookLoversClient | src/app/modules/bookcases/bookcase-statistics/store/tests/shelves-with-book.effects.spec.ts | TypeScript |
ArrowFunction |
async () => {
jest.resetAllMocks();
EntityService.getEntityUsages = jest.fn().mockResolvedValue(USAGES);
EntityService.getUsagesTotalRecords = jest.fn().mockResolvedValue(50);
mockRouter = {
push: jest.fn()
};
mockToast = {
add: jest.fn()
};
docSpy = jest.spyOn(document, "getElementById");
docSpy.mockReturnValue(undefined);
const warn = console.warn;
console.warn = jest.fn();
const error = console.error;
console.error = jest.fn();
wrapper = shallowMount(UsedIn, {
global: {
components: { DataTable, Column },
mocks: { $router: mockRouter, $toast: mockToast }
},
props: { conceptIri: "http://snomed.info/sct#298382003" }
});
await flushPromises();
jest.clearAllMocks();
console.warn = warn;
console.error = error;
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(wrapper.vm.selected).toStrictEqual({});
expect(wrapper.vm.usages).toStrictEqual(USAGES);
expect(wrapper.vm.loading).toBe(false);
expect(wrapper.vm.recordsTotal).toBe(50);
expect(wrapper.vm.currentPage).toBe(0);
expect(wrapper.vm.pageSize).toBe(25);
expect(wrapper.vm.scrollHeight).toBe("");
expect(wrapper.vm.templateString).toBe("Displaying {first} to {last} of {totalRecords} concepts");
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
async () => {
wrapper.vm.init = jest.fn();
wrapper.vm.$options.watch.conceptIri.call(wrapper.vm, "http://endhealth.info/im#DiscoveryOntology");
await wrapper.vm.$nextTick();
expect(wrapper.vm.init).toHaveBeenCalledTimes(1);
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
async () => {
console.error = jest.fn();
await flushPromises();
const spy = jest.spyOn(wrapper.vm, "setScrollHeight");
window.dispatchEvent(new Event("resize"));
await wrapper.vm.$nextTick();
expect(spy).toHaveBeenCalledTimes(1);
spy.mockReset();
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
console.error = jest.fn();
const spy = jest.spyOn(global, "removeEventListener");
wrapper.unmount();
expect(spy).toHaveBeenCalled();
spy.mockReset();
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
console.error = jest.fn();
console.warn = jest.fn();
wrapper.vm.setScrollHeight = jest.fn();
wrapper.vm.onResize();
expect(wrapper.vm.setScrollHeight).toHaveBeenCalledTimes(1);
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
async () => {
wrapper.vm.getUsages("http://snomed.info/sct#298382003", 0, 25);
await flushPromises();
expect(EntityService.getEntityUsages).toHaveBeenCalledTimes(1);
expect(EntityService.getEntityUsages).toHaveBeenCalledWith("http://snomed.info/sct#298382003", 0, 25);
expect(wrapper.vm.usages).toStrictEqual(USAGES);
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
async () => {
wrapper.vm.records = 0;
wrapper.vm.getRecordsSize("http://snomed.info/sct#298382003");
await flushPromises();
expect(EntityService.getUsagesTotalRecords).toHaveBeenCalledTimes(1);
expect(EntityService.getUsagesTotalRecords).toHaveBeenCalledWith("http://snomed.info/sct#298382003");
expect(wrapper.vm.recordsTotal).toBe(50);
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
wrapper.vm.getPage = jest.fn();
wrapper.vm.scrollToTop = jest.fn();
wrapper.vm.handlePage({ rows: 100, page: 7 });
expect(wrapper.vm.pageSize).toBe(100);
expect(wrapper.vm.currentPage).toBe(7);
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
async () => {
wrapper.vm.getUsages = jest.fn();
wrapper.vm.scrollToTop = jest.fn();
wrapper.vm.handlePage({ rows: 50, page: 7 });
expect(wrapper.vm.loading).toBe(true);
expect(wrapper.vm.pageSize).toBe(50);
expect(wrapper.vm.currentPage).toBe(7);
expect(wrapper.vm.getUsages).toHaveBeenCalledTimes(1);
expect(wrapper.vm.getUsages).toHaveBeenCalledWith("http://snomed.info/sct#298382003", 7, 50);
await flushPromises();
expect(wrapper.vm.scrollToTop).toHaveBeenCalledTimes(1);
expect(wrapper.vm.loading).toBe(false);
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
wrapper.vm.selected = { "@id": "testIri" };
wrapper.vm.handleSelected();
expect(mockRouter.push).toHaveBeenCalledTimes(1);
expect(mockRouter.push).toHaveBeenCalledWith({ name: "Concept", params: { selectedIri: "testIri" } });
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
wrapper.vm.handleSelected();
expect(mockRouter.push).not.toHaveBeenCalledTimes(1);
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
const mockElement = document.createElement("div");
mockElement.getBoundingClientRect = jest.fn().mockReturnValue({ height: 100 });
mockElement.scrollTop = 100;
mockElement.getElementsByClassName = jest.fn().mockReturnValue([mockElement]);
docSpy.mockReturnValue(mockElement);
wrapper.vm.scrollToTop();
expect(mockElement.scrollTop).toBe(0);
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
const mockElement = document.createElement("div");
mockElement.getBoundingClientRect = jest.fn().mockReturnValue({ height: 100 });
mockElement.scrollTop = 100;
mockElement.getElementsByClassName = jest.fn().mockReturnValue([undefined]);
docSpy.mockReturnValue(undefined);
wrapper.vm.scrollToTop();
expect(mockElement.scrollTop).toBe(100);
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
const mockElement = document.createElement("div");
mockElement.getBoundingClientRect = jest.fn().mockReturnValue({ height: 100 });
mockElement.scrollTop = 100;
mockElement.getElementsByClassName = jest.fn().mockReturnValue([mockElement]);
docSpy.mockReturnValue(mockElement);
wrapper.vm.setScrollHeight();
expect(wrapper.vm.scrollHeight).not.toBe("");
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
const mockElement = document.createElement("div");
mockElement.getBoundingClientRect = jest.fn().mockReturnValue({ height: 100 });
mockElement.scrollTop = 100;
mockElement.getElementsByClassName = jest.fn().mockReturnValue([undefined]);
docSpy.mockReturnValue(mockElement);
wrapper.vm.setScrollHeight();
expect(wrapper.vm.scrollHeight).not.toBe("500px");
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
() => {
wrapper.vm.setScrollHeight();
expect(wrapper.vm.scrollHeight).toBe("");
} | endeavourhealth-discovery/IMCatalogue | front-end-vue/tests/unit/components/concept/UsedIn.spec.ts | TypeScript |
ArrowFunction |
e => e.id === id | move4mobile/coders-workspace | libs/crm/badge/src/lib/services/badge.service.ts | TypeScript |
ArrowFunction |
row => Badge.fromRow(row) | move4mobile/coders-workspace | libs/crm/badge/src/lib/services/badge.service.ts | TypeScript |
ArrowFunction |
e => e.id | move4mobile/coders-workspace | libs/crm/badge/src/lib/services/badge.service.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class BadgeService {
constructor(private readonly data: DataService) {}
async findOneById(id: number): Promise<Badge> {
Logger.log(`Getting badge with id ${id}...`);
const badges = await this.findAll();
return badges.find(e => e.id === id);
}
async findAll(): Promise<Badge[]> {
return await this.getBadges();
}
private async getBadges() {
const rows = await this.data.getSpreadsheetRows(TAB_BADGES);
return rows.map(row => Badge.fromRow(row)).filter(e => e.id);
}
} | move4mobile/coders-workspace | libs/crm/badge/src/lib/services/badge.service.ts | TypeScript |
MethodDeclaration |
async findOneById(id: number): Promise<Badge> {
Logger.log(`Getting badge with id ${id}...`);
const badges = await this.findAll();
return badges.find(e => e.id === id);
} | move4mobile/coders-workspace | libs/crm/badge/src/lib/services/badge.service.ts | TypeScript |
MethodDeclaration |
async findAll(): Promise<Badge[]> {
return await this.getBadges();
} | move4mobile/coders-workspace | libs/crm/badge/src/lib/services/badge.service.ts | TypeScript |
MethodDeclaration |
private async getBadges() {
const rows = await this.data.getSpreadsheetRows(TAB_BADGES);
return rows.map(row => Badge.fromRow(row)).filter(e => e.id);
} | move4mobile/coders-workspace | libs/crm/badge/src/lib/services/badge.service.ts | TypeScript |
ArrowFunction |
({ label, name, ...rest }) => {
return (
<div className="textarea-block">
<label htmlFor={ name }>{ label }</label>
<textarea id={ name } { ...rest } />
</div> | gabrielmaqes/ProffyNLW2 | web/src/components/Textarea/index.tsx | TypeScript |
InterfaceDeclaration |
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
name: string;
label: string;
} | gabrielmaqes/ProffyNLW2 | web/src/components/Textarea/index.tsx | TypeScript |
ArrowFunction |
(props: ProjectsPageProps) => {
if (!props || props === undefined || Object.keys(props).length === 0) {
return <ErrorPage statusCode={404} />;
}
const { meta, data, type } = props;
const post = data;
return <Post post={post} meta={meta} />;
} | ifmakersd/ifmakersd.com.br | src/pages/posts/[slug].tsx | TypeScript |
ArrowFunction |
async () => {
const posts: Array<PostCMS> | null = await fetchPosts();
const paths = posts.map((project: PostCMS) => {
const params: Params = { params: { slug: project.slug } };
return params;
});
return {
paths,
fallback: false,
};
} | ifmakersd/ifmakersd.com.br | src/pages/posts/[slug].tsx | TypeScript |
ArrowFunction |
(project: PostCMS) => {
const params: Params = { params: { slug: project.slug } };
return params;
} | ifmakersd/ifmakersd.com.br | src/pages/posts/[slug].tsx | TypeScript |
ArrowFunction |
async ({ params }: Params) => {
const { slug } = params;
// specific project
const slugComplete = typeof slug === "string" ? slug : slug.join("/");
const post: PostCMS | null = await fetchPost(slugComplete);
if (!post || post === undefined) {
return { props: {} };
}
return {
props: {
meta: {
title: `${post.title} | IFMakerSD`,
description: `${post.description} | IFMakerSD`,
},
data: post,
type: "single",
},
};
} | ifmakersd/ifmakersd.com.br | src/pages/posts/[slug].tsx | TypeScript |
InterfaceDeclaration |
interface ProjectsPageProps {
meta: {
title: string;
description: string;
};
data: PostCMS;
type: string;
} | ifmakersd/ifmakersd.com.br | src/pages/posts/[slug].tsx | TypeScript |
TypeAliasDeclaration |
type Params = {
params: {
slug: string | string[];
};
}; | ifmakersd/ifmakersd.com.br | src/pages/posts/[slug].tsx | TypeScript |
ArrowFunction |
route => {
route.stops.forEach(stop => {
activeStops.add(stop);
});
} | max-wilkinson/mbus | src/stops/StopClient.ts | TypeScript |
ArrowFunction |
stop => {
activeStops.add(stop);
} | max-wilkinson/mbus | src/stops/StopClient.ts | TypeScript |
ArrowFunction |
stop => activeStops.has(stop.id) | max-wilkinson/mbus | src/stops/StopClient.ts | TypeScript |
ClassDeclaration |
export default class StopClient {
private readonly url = new URL('http://mbus.doublemap.com/map/v2/stops');
private readonly routeClient = new RouteClient();
public async GetStops() {
const routes = await this.routeClient.GetRoutes();
const stops = await getAsync(this.url);
return this.filterStops(stops, routes);
}
private filterStops(stops: Stop[], routes: Route[]): Stop[] {
let activeStops: Set<number> = new Set();
routes.forEach(route => {
route.stops.forEach(stop => {
activeStops.add(stop);
});
});
return stops.filter(stop => activeStops.has(stop.id));
}
} | max-wilkinson/mbus | src/stops/StopClient.ts | TypeScript |
MethodDeclaration |
public async GetStops() {
const routes = await this.routeClient.GetRoutes();
const stops = await getAsync(this.url);
return this.filterStops(stops, routes);
} | max-wilkinson/mbus | src/stops/StopClient.ts | TypeScript |
MethodDeclaration |
private filterStops(stops: Stop[], routes: Route[]): Stop[] {
let activeStops: Set<number> = new Set();
routes.forEach(route => {
route.stops.forEach(stop => {
activeStops.add(stop);
});
});
return stops.filter(stop => activeStops.has(stop.id));
} | max-wilkinson/mbus | src/stops/StopClient.ts | TypeScript |
InterfaceDeclaration |
export interface SmartTermItem {
value: string;
trailing?: boolean;
maybeTyping?: boolean;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface SmartQuery {
tokens: string[];
term: QueryTerm;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface QueryTermItem {
value: string;
presence: lunr.Query.presence;
wildcard: lunr.Query.wildcard;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface WrappedTerm {
missed: number;
term: SmartTerm;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface MatchMetadata {
[token: string]: {
[field: string]: {
position: MetadataPosition[];
};
};
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface HighlightChunk {
html: string;
textLength: number;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface ChunkIndexRef {
chunkIndex: number;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration | /**
* properties of document is shorten for smaller serialized search index.
*/
export interface SearchDocument {
/** Doc ID. */
i: number;
/** Doc title. */
t: string;
/** Doc URL. */
u: string;
/** Doc hash. */
h?: string;
/** Doc parent ID. */
p?: number;
/** Doc breadcrumb. */
b?: string[];
/** Doc section title */
s?: string;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface SearchResultBase {
document: SearchDocument;
type: SearchDocumentType;
page: SearchDocument | undefined | false;
metadata: MatchMetadata;
tokens: string[];
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface SearchResultExtra {
score: number;
index: number;
isInterOfTree: boolean;
isLastOfTree: boolean;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface WrappedIndex {
documents: SearchDocument[];
index: lunr.Index;
type: SearchDocumentType;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface ParsedDocument {
pageTitle: string;
sections: ParsedDocumentSection[];
breadcrumb: string[];
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface ParsedDocumentSection {
title: string;
hash: string;
content: string;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface DocInfoWithRoute {
route: string;
url: string;
type: DocInfoType;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface DocInfoWithFilePath {
filePath: string;
url: string;
type: DocInfoType;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface PluginOptions {
indexDocs?: boolean;
indexBlog?: boolean;
indexPages?: boolean;
docsRouteBasePath?: string | string[];
blogRouteBasePath?: string | string[];
language?: string | string[];
hashed?: boolean;
docsDir?: string | string[];
blogDir?: string | string[];
removeDefaultStopWordFilter?: boolean;
highlightSearchTermsOnTargetPage?: boolean;
searchResultLimits?: number;
searchResultContextMaxLength?: number;
translations?: TranslationMap;
ignoreFiles?: string | RegExp | (string | RegExp)[];
// searchInputPlaceholder?: string;
// searchNoResults?: string;
// searchSeeAllResults?: string;
// searchSeeAllResultsPlural?: string;
// searchPageResultLimits?: number;
// searchPageResultContextMaxLength?: number;
// searchPageInputPlaceholder?: string;
// searchPageNoResults?: string;
// searchPageDefaultTitle?: string;
// searchPageTitleWithKeyword?: string;
// searchPageResultSummary?: string;
// searchPageResultSummaryPlural?: string;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface PostBuildData {
routesPaths: string[];
outDir: string;
baseUrl: string;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface DocusaurusContext {
baseUrl: string;
siteDir: string;
generatedFilesDir: string;
} | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
TypeAliasDeclaration |
export type SmartTerm = SmartTermItem[]; | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
TypeAliasDeclaration |
export type QueryTerm = QueryTermItem[]; | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
TypeAliasDeclaration |
export type MetadataPosition = [number, number]; | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
TypeAliasDeclaration | /**
* - 0: Doc title
* - 1: Doc heading
* - 2: Doc content
*/
export type SearchDocumentType = 0 | 1 | 2; | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
TypeAliasDeclaration |
export type SearchResult = SearchResultBase & SearchResultExtra; | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
TypeAliasDeclaration |
export type InitialSearchResult = SearchResultBase & Partial<SearchResultExtra>; | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
TypeAliasDeclaration |
export type DocInfoType = "docs" | "blog" | "page"; | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
TypeAliasDeclaration |
export type ProcessedPluginOptions = Required<
Omit<
PluginOptions,
| "language"
| "docsRouteBasePath"
| "blogRouteBasePath"
| "docsDir"
| "blogDir"
| "ignoreFiles"
>
> & {
docsRouteBasePath: string[];
blogRouteBasePath: string[];
language: string[];
docsDir: string[];
blogDir: string[];
ignoreFiles: (string | RegExp)[];
}; | Farrser/docusaurus-search-local | src/shared/interfaces.ts | TypeScript |
FunctionDeclaration |
function apiManagementEmailTemplateTimeoutsToTerraform(struct?: ApiManagementEmailTemplateTimeoutsOutputReference | ApiManagementEmailTemplateTimeouts): any {
if (!cdktf.canInspect(struct)) { return struct; }
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
create: cdktf.stringToTerraform(struct!.create),
delete: cdktf.stringToTerraform(struct!.delete),
read: cdktf.stringToTerraform(struct!.read),
update: cdktf.stringToTerraform(struct!.update),
}
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
ClassDeclaration |
export class ApiManagementEmailTemplateTimeoutsOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param isSingleItem True if this is a block, false if it's a list
*/
public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) {
super(terraformResource, terraformAttribute, isSingleItem);
}
// create - computed: false, optional: true, required: false
private _create?: string | undefined;
public get create() {
return this.getStringAttribute('create');
}
public set create(value: string | undefined) {
this._create = value;
}
public resetCreate() {
this._create = undefined;
}
// Temporarily expose input value. Use with caution.
public get createInput() {
return this._create
}
// delete - computed: false, optional: true, required: false
private _delete?: string | undefined;
public get delete() {
return this.getStringAttribute('delete');
}
public set delete(value: string | undefined) {
this._delete = value;
}
public resetDelete() {
this._delete = undefined;
}
// Temporarily expose input value. Use with caution.
public get deleteInput() {
return this._delete
}
// read - computed: false, optional: true, required: false
private _read?: string | undefined;
public get read() {
return this.getStringAttribute('read');
}
public set read(value: string | undefined) {
this._read = value;
}
public resetRead() {
this._read = undefined;
}
// Temporarily expose input value. Use with caution.
public get readInput() {
return this._read
}
// update - computed: false, optional: true, required: false
private _update?: string | undefined;
public get update() {
return this.getStringAttribute('update');
}
public set update(value: string | undefined) {
this._update = value;
}
public resetUpdate() {
this._update = undefined;
}
// Temporarily expose input value. Use with caution.
public get updateInput() {
return this._update
}
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
ClassDeclaration | /**
* Represents a {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html azurerm_api_management_email_template}
*/
export class ApiManagementEmailTemplate extends cdktf.TerraformResource {
// =================
// STATIC PROPERTIES
// =================
public static readonly tfResourceType: string = "azurerm_api_management_email_template";
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html azurerm_api_management_email_template} Resource
*
* @param scope The scope in which to define this construct
* @param id The scoped construct ID. Must be unique amongst siblings in the same scope
* @param options ApiManagementEmailTemplateConfig
*/
public constructor(scope: Construct, id: string, config: ApiManagementEmailTemplateConfig) {
super(scope, id, {
terraformResourceType: 'azurerm_api_management_email_template',
terraformGeneratorMetadata: {
providerName: 'azurerm'
},
provider: config.provider,
dependsOn: config.dependsOn,
count: config.count,
lifecycle: config.lifecycle
});
this._apiManagementName = config.apiManagementName;
this._body = config.body;
this._resourceGroupName = config.resourceGroupName;
this._subject = config.subject;
this._templateName = config.templateName;
this._timeouts = config.timeouts;
}
// ==========
// ATTRIBUTES
// ==========
// api_management_name - computed: false, optional: false, required: true
private _apiManagementName?: string;
public get apiManagementName() {
return this.getStringAttribute('api_management_name');
}
public set apiManagementName(value: string) {
this._apiManagementName = value;
}
// Temporarily expose input value. Use with caution.
public get apiManagementNameInput() {
return this._apiManagementName
}
// body - computed: false, optional: false, required: true
private _body?: string;
public get body() {
return this.getStringAttribute('body');
}
public set body(value: string) {
this._body = value;
}
// Temporarily expose input value. Use with caution.
public get bodyInput() {
return this._body
}
// description - computed: true, optional: false, required: false
public get description() {
return this.getStringAttribute('description');
}
// id - computed: true, optional: true, required: false
public get id() {
return this.getStringAttribute('id');
}
// resource_group_name - computed: false, optional: false, required: true
private _resourceGroupName?: string;
public get resourceGroupName() {
return this.getStringAttribute('resource_group_name');
}
public set resourceGroupName(value: string) {
this._resourceGroupName = value;
}
// Temporarily expose input value. Use with caution.
public get resourceGroupNameInput() {
return this._resourceGroupName
}
// subject - computed: false, optional: false, required: true
private _subject?: string;
public get subject() {
return this.getStringAttribute('subject');
}
public set subject(value: string) {
this._subject = value;
}
// Temporarily expose input value. Use with caution.
public get subjectInput() {
return this._subject
}
// template_name - computed: false, optional: false, required: true
private _templateName?: string;
public get templateName() {
return this.getStringAttribute('template_name');
}
public set templateName(value: string) {
this._templateName = value;
}
// Temporarily expose input value. Use with caution.
public get templateNameInput() {
return this._templateName
}
// title - computed: true, optional: false, required: false
public get title() {
return this.getStringAttribute('title');
}
// timeouts - computed: false, optional: true, required: false
private _timeouts?: ApiManagementEmailTemplateTimeouts | undefined;
private __timeoutsOutput = new ApiManagementEmailTemplateTimeoutsOutputReference(this as any, "timeouts", true);
public get timeouts() {
return this.__timeoutsOutput;
}
public putTimeouts(value: ApiManagementEmailTemplateTimeouts | undefined) {
this._timeouts = value;
}
public resetTimeouts() {
this._timeouts = undefined;
}
// Temporarily expose input value. Use with caution.
public get timeoutsInput() {
return this._timeouts
}
// =========
// SYNTHESIS
// =========
protected synthesizeAttributes(): { [name: string]: any } {
return {
api_management_name: cdktf.stringToTerraform(this._apiManagementName),
body: cdktf.stringToTerraform(this._body),
resource_group_name: cdktf.stringToTerraform(this._resourceGroupName),
subject: cdktf.stringToTerraform(this._subject),
template_name: cdktf.stringToTerraform(this._templateName),
timeouts: apiManagementEmailTemplateTimeoutsToTerraform(this._timeouts),
};
}
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
InterfaceDeclaration | // Configuration
export interface ApiManagementEmailTemplateConfig extends cdktf.TerraformMetaArguments {
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html#api_management_name ApiManagementEmailTemplate#api_management_name}
*/
readonly apiManagementName: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html#body ApiManagementEmailTemplate#body}
*/
readonly body: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html#resource_group_name ApiManagementEmailTemplate#resource_group_name}
*/
readonly resourceGroupName: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html#subject ApiManagementEmailTemplate#subject}
*/
readonly subject: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html#template_name ApiManagementEmailTemplate#template_name}
*/
readonly templateName: string;
/**
* timeouts block
*
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html#timeouts ApiManagementEmailTemplate#timeouts}
*/
readonly timeouts?: ApiManagementEmailTemplateTimeouts;
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
InterfaceDeclaration |
export interface ApiManagementEmailTemplateTimeouts {
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html#create ApiManagementEmailTemplate#create}
*/
readonly create?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html#delete ApiManagementEmailTemplate#delete}
*/
readonly delete?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html#read ApiManagementEmailTemplate#read}
*/
readonly read?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/api_management_email_template.html#update ApiManagementEmailTemplate#update}
*/
readonly update?: string;
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
MethodDeclaration |
public resetCreate() {
this._create = undefined;
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
MethodDeclaration |
public resetDelete() {
this._delete = undefined;
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
MethodDeclaration |
public resetRead() {
this._read = undefined;
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
MethodDeclaration |
public resetUpdate() {
this._update = undefined;
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
MethodDeclaration |
public putTimeouts(value: ApiManagementEmailTemplateTimeouts | undefined) {
this._timeouts = value;
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
MethodDeclaration |
public resetTimeouts() {
this._timeouts = undefined;
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
MethodDeclaration | // =========
// SYNTHESIS
// =========
protected synthesizeAttributes(): { [name: string]: any } {
return {
api_management_name: cdktf.stringToTerraform(this._apiManagementName),
body: cdktf.stringToTerraform(this._body),
resource_group_name: cdktf.stringToTerraform(this._resourceGroupName),
subject: cdktf.stringToTerraform(this._subject),
template_name: cdktf.stringToTerraform(this._templateName),
timeouts: apiManagementEmailTemplateTimeoutsToTerraform(this._timeouts),
};
} | terraform-cdk-providers/cdktf-provider-azurerm | src/api-management-email-template.ts | TypeScript |
ArrowFunction |
(request: Request) => request?.cookies?.Authentication | Yasha09/nest-gql | src/auth/strategies/jwt.strategy.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy) {
constructor(
configService: ConfigService,
private readonly userService: UsersService,
) {
super({
jwtFromRequest: ExtractJwt.fromExtractors([
(request: Request) => request?.cookies?.Authentication,
]),
secretOrKey: configService.get('JWT_SECRET'),
});
}
async validate({ userId }: TokenPayload) {
return this.userService.getUser({ _id: userId });
}
} | Yasha09/nest-gql | src/auth/strategies/jwt.strategy.ts | TypeScript |
MethodDeclaration |
async validate({ userId }: TokenPayload) {
return this.userService.getUser({ _id: userId });
} | Yasha09/nest-gql | src/auth/strategies/jwt.strategy.ts | TypeScript |
ArrowFunction |
(error: any): Observable<T> => {
// TODO: send the error to remote logging infrastructure
console.error(error); // log to console instead
// TODO: better jobOrder of transforming error for user consumption
this.log(`${operation} failed: ${error.message}`);
// Let the app keep running by returning an empty result.
return of(result as T);
} | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
_ => this.log('fetched opDefs') | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
(value, key) => {
qstr += `${key}=${value}&`;
} | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
opds => opds[0] | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
opd => {
const outcome = opd ? `fetched` : `did not find`;
this.log(`${outcome} OpDef _id=${qstr}`);
} | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
_ => this.log('fetch new opDef ') | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
_ => this.log('fetch opDef id=${id}') | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
_ => this.log(`found searchOpdDefs matching "${qstr}"`) | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
_ => this.log(`found OpDef matching "${query}"`) | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
(newOpDef: IOpDef) => this.log(`added opd w/ id=${newOpDef._id}`) | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
_ => this.log(`updated opd id=${opd._id}`) | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |
ArrowFunction |
_ => this.log(`patch opd id=${id}`) | giim-mibd/app-ngx-client | src/app/@core/data/op-def.service.ts | TypeScript |