type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
public getUserInfo() {
let info = this.getLocalStorageToken();
if (info) { return { id: info["session_id"], username: info["username"], name: info["name"] }; }
} | PauloHenriqueFernandesAraujo/AngularMaterializeStruct | src/app/generic/services/communication.service.ts | TypeScript |
MethodDeclaration |
private getLocalStorageToken() {
let local = localStorage.getItem(Constants.STORAGE_USER_SESSION);
if (isNullOrUndefined(local)) return null;
let obj = JSON.parse(local);
if (isNullOrUndefined(obj)) return null;
return obj;
} | PauloHenriqueFernandesAraujo/AngularMaterializeStruct | src/app/generic/services/communication.service.ts | TypeScript |
MethodDeclaration |
private errorValidate(result: any) {
if (!result.success) {
if (!isNullOrUndefined(result.modelState)) {
if (result.modelState.message == "USR_LOGIN") { this.router.navigate(['/entrar']); }
//adicionar demais erros aqui
}
}
} | PauloHenriqueFernandesAraujo/AngularMaterializeStruct | src/app/generic/services/communication.service.ts | TypeScript |
ClassDeclaration |
@Component({
selector: "ngx-powerbi-component",
template: '<div #ngxPowerBiIFrame style="height:100%; width: 100%;"></div>',
styles: [],
})
export class NgxPowerBiComponent
implements AfterViewInit, OnChanges, OnDestroy
{
// Public properties
@Input() accessToken: string;
@Input() tokenType: TokenType;
... | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
EnumDeclaration |
export const enum TokenType {
Aad = "Aad",
Embed = "Embed",
} | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
EnumDeclaration |
export const enum ReportType {
Dashboard = "Dashboard",
Report = "Report",
Tile = "Tile",
} | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
MethodDeclaration |
ngAfterViewInit() {
// Embed the report inside the view child that we have fetched from the DOM
if (
this.ngxPowerBiIFrameRef.nativeElement &&
this.validateRequiredAttributes()
) {
this.embed(this.ngxPowerBiIFrameRef.nativeElement, this.getConfig());
}
} | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
MethodDeclaration |
ngOnChanges(changes: SimpleChanges) {
if (!this.ngxPowerBiIFrameRef) {
return;
}
const {
accessToken,
tokenType,
embedUrl,
id,
type,
name,
options,
viewMode,
} = changes;
// TODO: Validate these conditions
/*if (
(accessToken.previous... | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
MethodDeclaration |
ngOnDestroy() {
if (this.component) {
this.reset(this.ngxPowerBiIFrameRef.nativeElement);
}
} | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
MethodDeclaration | /**
* Ensure required attributes (embedUrl and accessToken are valid before attempting to embed)
*/
private validateRequiredAttributes(): boolean {
return (
typeof this.embedUrl === "string" &&
this.embedUrl.length > 0 &&
typeof this.accessToken === "string" &&
this.accessToken.length ... | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
MethodDeclaration | /**
* Get the model class compatible token enum from our token type enum
* @param tokenType - Token type in our custom enum format
* @returns Token type in powerbi-models.TokenType enum format
*/
private getTokenType(tokenType: TokenType): models.TokenType {
if (tokenType) {
switch (tokenType) {
... | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
MethodDeclaration | /**
* Returns an embed configuration object.
* @param accessToken - Access token required to embed a component
* @param tokenType - type of accessToken: Aad or Embed
* @param embedUrl - Embed URL obtained through Power BI REST API or Portal
* @param id - component/element GUID
* @param type - type of ... | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
MethodDeclaration | /**
* Given an HTMLElement, construct an embed configuration based on attributes and pass to service.
* @param element - native element where the embedding needs to be done
* @param config - configuration to be embedded
*/
private embed(element: HTMLElement, config: pbi.IEmbedConfiguration) {
/*if (this... | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
MethodDeclaration | /**
* Reset the component that has been removed from DOM.
* @param element - native element where the embedded was made
*/
reset(element: HTMLElement) {
this.powerBiService.reset(element);
this.component = null;
} | fanil-kashapov/ngx-powerbi | projects/ngx-powerbi/src/lib/ngx-powerbi.component.ts | TypeScript |
ArrowFunction |
() => {
let component: PresupuestoContainerComponent;
let fixture: ComponentFixture<PresupuestoContainerComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PresupuestoContainerComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = Test... | noetipo/SB-Admin-BS4-Angular-6 | src/app/layout/partida/presupuesto-container/presupuesto-container.component.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
declarations: [ PresupuestoContainerComponent ]
})
.compileComponents();
} | noetipo/SB-Admin-BS4-Angular-6 | src/app/layout/partida/presupuesto-container/presupuesto-container.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(PresupuestoContainerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
} | noetipo/SB-Admin-BS4-Angular-6 | src/app/layout/partida/presupuesto-container/presupuesto-container.component.spec.ts | TypeScript |
ArrowFunction |
(lang: string): void => {
document.querySelector("html")?.setAttribute("lang", lang);
const defaultVariables = defaultVars[lang] || defaultVars.en;
if (i18next.options.interpolation) {
i18next.options.interpolation.defaultVariables = defaultVariables;
} else {
i18next.options.interpola... | kongkang/flat | desktop/renderer-app/src/utils/i18n.ts | TypeScript |
FunctionDeclaration |
function SvgCat(props: React.SVGProps<SVGSVGElement>) {
return (
<svg
data-name='Layer 3'
xmlns='http://www.w3.org/2000/svg'
viewBox='0 0 24 24'
width='1em'
height='1em'
{...props}
>
<path
d='M15.074 6.42l2.389-2.047A1.537 1.537 0 0120 5.54V13a8 8 0 01-8 8h0a... | ProNoob702/suivi-icons | src/icons/Cat.tsx | TypeScript |
ArrowFunction |
() => {
store = createStore(clone(wpSource()));
store.state.source.api = "https://test.frontity.org/wp-json";
store.actions.source.init();
api = store.libraries.source.api as jest.Mocked<Api>;
} | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
() => {
test("returns 404 if not found", async () => {
// Mock Api responses
// We have to use this form instead of:
// .mockResolvedValueOnce(mockResponse([]))
// because the latter always returns the same instance of Response.
// which results in error because response.json() can only be run on... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Mock Api responses
// We have to use this form instead of:
// .mockResolvedValueOnce(mockResponse([]))
// because the latter always returns the same instance of Response.
// which results in error because response.json() can only be run once
api.get = jest.fn((_) => Promise.res... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
(_) => Promise.resolve(mockResponse([])) | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Mock Api responses
api.get = jest.fn(async (_) => {
throw new ServerError("statusText", 400, "statusText");
});
// Fetch entities
await store.actions.source.fetch("/post-1/");
expect(store.state.source.data["/post-1/"].isError).toBe(true);
expect(store.state.source.... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async (_) => {
throw new ServerError("statusText", 400, "statusText");
} | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
() => {
test("doesn't exist in source.post", async () => {
// Mock Api responses
api.get = jest.fn().mockResolvedValueOnce(mockResponse([post1]));
// Fetch entities
await store.actions.source.fetch("/post-1/");
expect(store.state.source).toMatchSnapshot();
});
test("exists in source.post", a... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Mock Api responses
api.get = jest.fn().mockResolvedValueOnce(mockResponse([post1]));
// Fetch entities
await store.actions.source.fetch("/post-1/");
expect(store.state.source).toMatchSnapshot();
} | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Add post to the store
await store.libraries.source.populate({
state: store.state,
response: mockResponse(post1),
});
// Mock Api responses
api.get = jest.fn();
// Fetch entities
await store.actions.source.fetch("/post-1/");
expect(api.get).not.toHaveBeenCall... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Add custom post endpoint and params
store.state.source.postEndpoint = "multiple-post-type";
store.state.source.params = { type: ["post", "cpt"] };
// Mock Api responses
api.get = jest.fn().mockResolvedValueOnce(mockResponse([cpt11]));
// Fetch entities
await store.actions.s... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Mock Api responses
api.get = jest.fn().mockResolvedValueOnce(mockResponse([post1]));
// Fetch entities
await store.actions.source.fetch("/post-1/?some=param");
expect(store.state.source).toMatchSnapshot();
} | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Add post to the store
await store.libraries.source.populate({
state: store.state,
response: mockResponse(post1),
});
// Mock Api responses
api.get = jest.fn();
// Fetch entities
await store.actions.source.fetch("/post-1/?some=param");
expect(api.get).not.toH... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Mock Api responses
api.get = jest.fn().mockResolvedValueOnce(mockResponse([post1withType]));
// Fetch entities
await store.actions.source.fetch("/post-1/");
expect(store.state.source).toMatchSnapshot();
} | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
() => {
test("doesn't exist in source.page", async () => {
// Mock Api responses
api.get = jest
.fn()
.mockResolvedValueOnce(mockResponse([]))
.mockResolvedValueOnce(mockResponse([page1]));
// Fetch entities
await store.actions.source.fetch("/page-1/");
expect(store.state.source... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Mock Api responses
api.get = jest
.fn()
.mockResolvedValueOnce(mockResponse([]))
.mockResolvedValueOnce(mockResponse([page1]));
// Fetch entities
await store.actions.source.fetch("/page-1/");
expect(store.state.source).toMatchSnapshot();
} | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Add page to the store
await store.libraries.source.populate({
state: store.state,
response: mockResponse(page1),
});
// Mock Api responses
api.get = jest.fn().mockResolvedValueOnce(mockResponse([]));
// Fetch entities
await store.actions.source.fetch("/page-1/")... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Mock Api responses
api.get = jest
.fn()
.mockResolvedValueOnce(mockResponse([]))
.mockResolvedValueOnce(mockResponse([page1]));
// Fetch entities
await store.actions.source.fetch("/page-1/?some=param");
expect(store.state.source).toMatchSnapshot();
} | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Add page to the store
await store.libraries.source.populate({
state: store.state,
response: mockResponse(page1),
});
// Mock Api responses
api.get = jest.fn().mockResolvedValueOnce(mockResponse([]));
// Fetch entities
await store.actions.source.fetch("/page-1/?s... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
() => {
test("doesn't exist in source.attachment", async () => {
// Mock Api responses
api.get = jest
.fn()
.mockResolvedValueOnce(mockResponse([]))
.mockResolvedValueOnce(mockResponse([attachment1]));
// Fetch entities
await store.actions.source.fetch("/post-1/attachment-1/");
... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Mock Api responses
api.get = jest
.fn()
.mockResolvedValueOnce(mockResponse([]))
.mockResolvedValueOnce(mockResponse([attachment1]));
// Fetch entities
await store.actions.source.fetch("/post-1/attachment-1/");
expect(store.state.source).toMatchSnapshot();
} | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Add attachment to the store
await store.libraries.source.populate({
state: store.state,
response: mockResponse(attachment1),
});
// Mock Api responses
api.get = jest.fn().mockResolvedValue(mockResponse([]));
// Fetch entities
await store.actions.source.fetch("/p... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Mock Api responses
api.get = jest
.fn()
.mockResolvedValueOnce(mockResponse([]))
.mockResolvedValueOnce(mockResponse([attachment1]));
// Fetch entities
await store.actions.source.fetch("/post-1/attachment-1/?some=param");
expect(store.state.source).toMatchSnapshot... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Add attachment to the store
await store.libraries.source.populate({
state: store.state,
response: mockResponse(attachment1),
});
// Mock Api responses
api.get = jest.fn().mockResolvedValue(mockResponse([]));
// Fetch entities
await store.actions.source.fetch("/p... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
// Mock Api responses
api.get = jest
.fn()
.mockResolvedValueOnce(mockResponse([post1]))
.mockResolvedValueOnce(mockResponse(attachment1));
// Fetch entities
await store.actions.source.fetch("/post-1");
await store.actions.source.fetch("/post-1", { force: true });
... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
api.get = jest.fn((_) =>
Promise.resolve(
mockResponse([
{
id: 1,
slug: "post-1",
type: "post",
link: "https://test.frontity.org/post-1/",
},
])
)
);
await store.actions.source.fetch("/undefined/p... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
(_) =>
Promise.resolve(
mockResponse([
{
id: 1,
slug: "post-1",
type: "post",
link: "https://test.frontity.org/post-1/",
},
])
) | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
ArrowFunction |
async () => {
api.get = jest.fn((_) =>
Promise.resolve(
mockResponse([
{
id: 1,
slug: "post-1",
type: "post",
link: "https://test.frontity.org/post-1/",
},
])
)
);
await store.actions.source.fetch("/does/not/ex... | kbav/frontity | packages/wp-source/src/libraries/handlers/__tests__/post-type.tests.ts | TypeScript |
FunctionDeclaration | /**
* Given a URL pointing to a file on a provider, returns a URL that is suitable
* for fetching the contents of the data.
*
* Converts
* from: https://dev.azure.com/{organization}/{project}/_git/reponame?path={path}&version=GB{commitOrBranch}&_a=contents
* to: https://dev.azure.com/{organization}/{project}/_a... | Xantier/backstage | packages/integration/src/azure/core.ts | TypeScript |
FunctionDeclaration | /**
* Given a URL pointing to a path on a provider, returns a URL that is suitable
* for downloading the subtree.
*
* @param url A URL pointing to a path
*/
export function getAzureDownloadUrl(url: string): string {
const {
name: repoName,
owner: project,
organization,
protocol,
resource,
... | Xantier/backstage | packages/integration/src/azure/core.ts | TypeScript |
FunctionDeclaration | /**
* Gets the request options necessary to make requests to a given provider.
*
* @param config The relevant provider config
*/
export function getAzureRequestOptions(
config: AzureIntegrationConfig,
additionalHeaders?: Record<string, string>,
): RequestInit {
const headers: HeadersInit = additionalHeaders
... | Xantier/backstage | packages/integration/src/azure/core.ts | TypeScript |
InterfaceDeclaration |
export interface Card {
title: string;
type: CardType;
icon: IconName;
href: string;
check: () => Promise<boolean>;
done: boolean;
heading: string;
learnHref?: string;
} | 3LOQ/grafana | public/app/plugins/panel/gettingstarted/types.ts | TypeScript |
InterfaceDeclaration |
export interface TutorialCardType extends Card {
info?: string;
// For local storage
key: string;
} | 3LOQ/grafana | public/app/plugins/panel/gettingstarted/types.ts | TypeScript |
InterfaceDeclaration |
export interface SetupStep {
heading: string;
subheading: string;
title: string;
info: string;
cards: (Card | TutorialCardType)[];
done: boolean;
} | 3LOQ/grafana | public/app/plugins/panel/gettingstarted/types.ts | TypeScript |
TypeAliasDeclaration |
export type CardType = 'tutorial' | 'docs' | 'other'; | 3LOQ/grafana | public/app/plugins/panel/gettingstarted/types.ts | TypeScript |
ArrowFunction |
(props) => {
// const [topics, setTopics] = useState<firebase.firestore.DocumentData>({});
const { data, loading } = useContext(LadderContext);
// useEffect(() => {
// const fetchData = () => {
// firestore
// .collection("ladders")
// .get()
// .then((ladderList) => {
// ... | AyaanJaved/ladderly-web | ladderly-react/src/pages/AppContainer/Topics.page.tsx | TypeScript |
ArrowFunction |
(keyName, keyIndex) => {
return (
<Card
key={keyIndex}
title={keyName}
questions={data[0].topics[keyName]}
className="w-full col-span-12 sm:col-span-6 lg:col-span-4"
topicLink={keyName}
/> | AyaanJaved/ladderly-web | ladderly-react/src/pages/AppContainer/Topics.page.tsx | TypeScript |
InterfaceDeclaration |
interface Props {} | AyaanJaved/ladderly-web | ladderly-react/src/pages/AppContainer/Topics.page.tsx | TypeScript |
FunctionDeclaration |
function Demo() {
return (
<Group position="center">
<Badge variant="gradient" gradient={{ from: 'indigo', to: 'cyan' }} | Anishpras/mantine | src/mantine-demos/src/demos/packages/Badge/gradient.tsx | TypeScript |
ArrowFunction |
async (packet, referrerObj) => {
const query = new Query(packet);
const referrer = new Referrer(referrerObj);
this.emit("query", query, referrer);
} | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
ArrowFunction |
(packet, referrerObj) => {
const res = Response.parse(packet, { binaryTXT: this.options.binaryTXT });
const referrer = new Referrer(referrerObj);
this.emit("response", res, referrer);
} | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
this.mdns.query(query, err => {
if (err) return reject(err);
resolve();
});
} | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
ArrowFunction |
err => {
if (err) return reject(err);
resolve();
} | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
this.mdns.respond(Response.serialize(res, { binaryTXT: this.options.binaryTXT }), err => {
if (err) return reject(err);
resolve();
});
} | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
this.mdns.destroy(err => {
if (err) return reject(err);
resolve();
});
} | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
ClassDeclaration |
export default class MDNSTransport extends EventEmitter implements Transport {
options: TransportOptions;
destroyed: boolean = false;
// tslint:disable-next-line:no-any
mdns: any;
constructor(options: TransportOptions = {}) {
super();
this.options = options;
this.mdns = multicastdns();
this... | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
MethodDeclaration |
async query(query: Query) {
return new Promise<void>((resolve, reject) => {
this.mdns.query(query, err => {
if (err) return reject(err);
resolve();
});
});
} | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
MethodDeclaration |
async respond(res: Response) {
return await new Promise<void>((resolve, reject) => {
this.mdns.respond(Response.serialize(res, { binaryTXT: this.options.binaryTXT }), err => {
if (err) return reject(err);
resolve();
});
});
} | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
MethodDeclaration |
async destroy() {
if (this.destroyed) return;
this.destroyed = true;
await new Promise<void>((resolve, reject) => {
this.mdns.destroy(err => {
if (err) return reject(err);
resolve();
});
});
} | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
MethodDeclaration |
getAddresses(): Array<{ family: string, address: string }> {
return MDNSUtils.getExternalAddresses();
} | dizzyluo/spread-the-word | src/Transports/MDNSTransport.ts | TypeScript |
FunctionDeclaration |
function handleNavigateToBack() {
navigation.goBack();
} | huandrey/Ecoleta | Booster/mobile/src/pages/Detail/index.tsx | TypeScript |
FunctionDeclaration |
function handleComposeMail() {
MailComposer.composeAsync({
subject: 'Gostaria de saber um pouco mais sobre a coleta de resíduos',
recipients: [data.point.email]
})
} | huandrey/Ecoleta | Booster/mobile/src/pages/Detail/index.tsx | TypeScript |
FunctionDeclaration |
function handleWhatsapp() {
Linking.openURL(`whatsapp://send?phone=${data.point.whatsapp}&tenho interesse sobre a coleta de resíduos`);
} | huandrey/Ecoleta | Booster/mobile/src/pages/Detail/index.tsx | TypeScript |
ArrowFunction |
() => {
const [data, setData] = useState<Data>({} as Data);
const navigation = useNavigation();
const route = useRoute();
const routeParams = route.params as Params;
useEffect(() => {
api.get(`points/${routeParams.point_id}`).then(response => {
setData(response.da... | huandrey/Ecoleta | Booster/mobile/src/pages/Detail/index.tsx | TypeScript |
ArrowFunction |
() => {
api.get(`points/${routeParams.point_id}`).then(response => {
setData(response.data)
})
} | huandrey/Ecoleta | Booster/mobile/src/pages/Detail/index.tsx | TypeScript |
ArrowFunction |
response => {
setData(response.data)
} | huandrey/Ecoleta | Booster/mobile/src/pages/Detail/index.tsx | TypeScript |
ArrowFunction |
item => item.title | huandrey/Ecoleta | Booster/mobile/src/pages/Detail/index.tsx | TypeScript |
InterfaceDeclaration |
interface Params {
point_id: number;
} | huandrey/Ecoleta | Booster/mobile/src/pages/Detail/index.tsx | TypeScript |
InterfaceDeclaration |
interface Data {
point: {
image: string;
image_url: string;
name: string;
email: string;
whatsapp: string;
city: string;
uf: string;
};
items: {
title: string;
}[];
} | huandrey/Ecoleta | Booster/mobile/src/pages/Detail/index.tsx | TypeScript |
InterfaceDeclaration |
export interface SparklineOptions {
show: boolean;
} | smartems/smartems | public/app/plugins/panel/singlestat2/types.ts | TypeScript |
InterfaceDeclaration | // Structure copied from angular
export interface SingleStatOptions extends SingleStatBaseOptions {
sparkline: SparklineOptions;
colorMode: ColorMode;
displayMode: SingleStatDisplayMode;
} | smartems/smartems | public/app/plugins/panel/singlestat2/types.ts | TypeScript |
EnumDeclaration |
export enum ColorMode {
Thresholds,
Series,
} | smartems/smartems | public/app/plugins/panel/singlestat2/types.ts | TypeScript |
EnumDeclaration | /*
* Copyright 2020 Salto Labs Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | eladmallel/salto | packages/workspace/src/parser/language.ts | TypeScript |
InterfaceDeclaration |
export interface RespCoreCacheMiss {
time: number[];
values: {
mpki: {
l1d_mpki: number[],
l1i_mpki: number[],
l2d_mpki: number[],
l2i_mpki: number[],
},
percentage: {
l1d_missrate: number[],
l1i_missrate: number[],
l2d_missrate: number[],
l2i_missrate: n... | kunpengcompute/devkit-vscode-plugin | workspace/projects/sys/src-com/app/mission-analysis/ddrtab-detail/ddr-summury/domain/resp-core-cache-miss.interface.ts | TypeScript |
ArrowFunction |
(): JSX.Element => {
return <BlogSearch />;
} | almond-hydroponics/almond-dashboard | src/pages/blog-search.tsx | TypeScript |
ArrowFunction |
(name, value) => {
this.setState({
isInline: value === 'inline',
});
} | uidu-org/guidu | packages/forms/radio/examples/Grid.tsx | TypeScript |
ClassDeclaration |
export default class Grid extends Component<any, any> {
state = {
isInline: false,
};
onChange = (name, value) => {
this.setState({
isInline: value === 'inline',
});
};
render() {
const { isInline } = this.state;
return (
<Form {...formDefaultProps}>
<RadioGrid
... | uidu-org/guidu | packages/forms/radio/examples/Grid.tsx | TypeScript |
MethodDeclaration |
render() {
const { isInline } = this.state;
return (
<Form {...formDefaultProps}>
<RadioGrid
{...inputDefaultProps}
isInline={isInline}
options={defaultOptions.slice(0, 5)}
// onBlur={this.onBlur}
// onFocus={this.onFocus}
label="With ch... | uidu-org/guidu | packages/forms/radio/examples/Grid.tsx | TypeScript |
FunctionDeclaration | /**
* The description of the IoT hub.
*/
export function getIotHubResource(args: GetIotHubResourceArgs, opts?: pulumi.InvokeOptions): Promise<GetIotHubResourceResult> {
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
return pulumi.runtime.inv... | polivbr/pulumi-azure-native | sdk/nodejs/devices/v20181201preview/getIotHubResource.ts | TypeScript |
InterfaceDeclaration |
export interface GetIotHubResourceArgs {
/**
* The name of the resource group that contains the IoT hub.
*/
resourceGroupName: string;
/**
* The name of the IoT hub.
*/
resourceName: string;
} | polivbr/pulumi-azure-native | sdk/nodejs/devices/v20181201preview/getIotHubResource.ts | TypeScript |
InterfaceDeclaration | /**
* The description of the IoT hub.
*/
export interface GetIotHubResourceResult {
/**
* The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention.
*/
readonly etag?: string;
/**
* The resource identifier.
... | polivbr/pulumi-azure-native | sdk/nodejs/devices/v20181201preview/getIotHubResource.ts | TypeScript |
ArrowFunction |
() => {
let component: TextFieldEditorValidationComponent;
let fixture: ComponentFixture<TextFieldEditorValidationComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
TextFieldEditorValidationComponent,
TextFieldComponent
],
imports: [
... | Softheon/angular-forge | projects/forge-lib/src/lib/shared/form-editor-components/concrete/text-field-editor/validation/text-field-editor-validation.component.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
declarations: [
TextFieldEditorValidationComponent,
TextFieldComponent
],
imports: [
FormsModule
]
})
.compileComponents();
} | Softheon/angular-forge | projects/forge-lib/src/lib/shared/form-editor-components/concrete/text-field-editor/validation/text-field-editor-validation.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(TextFieldEditorValidationComponent);
component = fixture.componentInstance;
component.component = new TextFieldComponent();
fixture.detectChanges();
} | Softheon/angular-forge | projects/forge-lib/src/lib/shared/form-editor-components/concrete/text-field-editor/validation/text-field-editor-validation.component.spec.ts | TypeScript |
ArrowFunction |
event => {
} | congphuong1606/hrmOmi | resources/assets/src/app/services/TokenInterceptor.ts | TypeScript |
ArrowFunction |
error => {
if (error.status === 401) {
this.router.navigate(['/login']);
localStorage.clear();
}
} | congphuong1606/hrmOmi | resources/assets/src/app/services/TokenInterceptor.ts | TypeScript |
ArrowFunction |
() => {
} | congphuong1606/hrmOmi | resources/assets/src/app/services/TokenInterceptor.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class TokenInterceptor implements HttpInterceptor {
constructor(public auth: AuthService, private router: Router) {
}
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
request = request.clone({
setHeaders: {
Auth... | congphuong1606/hrmOmi | resources/assets/src/app/services/TokenInterceptor.ts | TypeScript |
MethodDeclaration |
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
request = request.clone({
setHeaders: {
Authorization: 'Bearer' + this.auth.getToken(),
Accept: 'application/json',
}
});
return next.handle(request).pip... | congphuong1606/hrmOmi | resources/assets/src/app/services/TokenInterceptor.ts | TypeScript |
ArrowFunction |
async <T>(
logger: ILogger,
name: string,
fn: () => T | Promise<T>,
metadata: object = {},
): Promise<T> => {
const start = Date.now();
try {
return await fn();
} finally {
logger.verbose(LogTag.PerfFunction, '', {
method: name,
duration: Date.now() - start,
...metadata,
});... | Ashikpaul/vscode-js-debug | src/telemetry/performance.ts | TypeScript |
ArrowFunction |
(request, response) => response.json({ message: 'Hello World' }) | erickSuh/005-typescript-nodejs-example | src/server.ts | TypeScript |
ArrowFunction |
() => {
const { mnemonic } = useMemo(() => new MnemonicKey(), []) // must be memoized
return (
<CreateWalletWizard defaultMnemonic={mnemonic} beforeCreate={<Quiz />} | daodiseomoney/station | src/auth/modules/create/NewWalletForm.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.