type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
() => {
let component: ReportInventoryPage;
let fixture: ComponentFixture<ReportInventoryPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ReportInventoryPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fi... | Subdy/Viethas-sales | src/app/pages/report/report-inventory/report-inventory.page.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
declarations: [ ReportInventoryPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
} | Subdy/Viethas-sales | src/app/pages/report/report-inventory/report-inventory.page.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(ReportInventoryPage);
component = fixture.componentInstance;
fixture.detectChanges();
} | Subdy/Viethas-sales | src/app/pages/report/report-inventory/report-inventory.page.spec.ts | TypeScript |
InterfaceDeclaration |
interface IntrinsicAttributes {
isToggled?: boolean;
onClick?: (any?) => void;
} | juliusrajala/jouluristeily.com | types.d.ts | TypeScript |
FunctionDeclaration |
export function expectArraysClose(
actual: Tensor|TypedArray|number[],
expected: Tensor|TypedArray|number[]|boolean[], epsilon = TEST_EPSILON) {
if (!(actual instanceof Tensor) && !(expected instanceof Tensor)) {
const aType = actual.constructor.name;
const bType = expected.constructor.name;
if ... | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
FunctionDeclaration |
export function expectArraysEqual(
actual: Tensor|TypedArray|number[],
expected: Tensor|TypedArray|number[]|boolean[]) {
return expectArraysClose(actual, expected, 0);
} | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
FunctionDeclaration |
export function expectNumbersClose(
a: number, e: number, epsilon = TEST_EPSILON) {
if (!areClose(a, e, epsilon)) {
throw new Error(`Numbers differ: actual === ${a}, expected === ${e}`);
}
} | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
FunctionDeclaration |
function areClose(a: number, e: number, epsilon: number): boolean {
if (isNaN(a) && isNaN(e)) {
return true;
}
if (isNaN(a) || isNaN(e) || Math.abs(a - e) > epsilon) {
return false;
}
return true;
} | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
FunctionDeclaration |
export function expectValuesInRange(
actual: Tensor|TypedArray|number[], low: number, high: number) {
let actualVals: TypedArray|number[];
if (actual instanceof Tensor) {
actualVals = actual.dataSync();
} else {
actualVals = actual;
}
for (let i = 0; i < actualVals.length; i++) {
if (actualVa... | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
FunctionDeclaration |
export function describeWithFlags(
name: string, featuresList: Features[], tests: () => void) {
featuresList.forEach(features => {
const testName = name + ' ' + JSON.stringify(features);
executeTests(testName, tests, features);
});
} | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
FunctionDeclaration |
function executeTests(
testName: string, tests: () => void, features?: Features) {
describe(testName, () => {
beforeEach(() => {
ENV.setFeatures(features || {});
ENV.addCustomBackend('webgl', () => new MathBackendWebGL());
ENV.addCustomBackend('cpu', () => new MathBackendCPU());
if (f... | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
FunctionDeclaration |
export function assertIsNan(val: number, dtype: DataType) {
if (!util.isValNaN(val, dtype)) {
throw new Error(`Value ${val} does not represent NaN for dtype ${dtype}`);
}
} | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
ArrowFunction |
features => {
const testName = name + ' ' + JSON.stringify(features);
executeTests(testName, tests, features);
} | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(() => {
ENV.setFeatures(features || {});
ENV.addCustomBackend('webgl', () => new MathBackendWebGL());
ENV.addCustomBackend('cpu', () => new MathBackendCPU());
if (features && features.BACKEND != null) {
Environment.setBackend(features.BACKEND);
}
ENV.e... | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
ArrowFunction |
() => {
ENV.setFeatures(features || {});
ENV.addCustomBackend('webgl', () => new MathBackendWebGL());
ENV.addCustomBackend('cpu', () => new MathBackendCPU());
if (features && features.BACKEND != null) {
Environment.setBackend(features.BACKEND);
}
ENV.engine.startScope();
... | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
ArrowFunction |
() => new MathBackendWebGL() | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
ArrowFunction |
() => new MathBackendCPU() | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
ArrowFunction |
() => {
ENV.engine.endScope(null);
ENV.reset();
} | Acidburn0zzz/deeplearnjs | src/test_util.ts | TypeScript |
ArrowFunction |
() => {
return (
<div className="text-center">
<Button type="primary">Button</Button>
</div> | joey2217/react-paint-app | src/App.tsx | TypeScript |
InterfaceDeclaration |
export interface INumberFormatOptions extends NumberFormatOptions {
compactDisplay?: INumberFormatCompactDisplay;
currency?: INumberFormatCurrency;
currencyDisplay?: INumberFormatCurrencyDisplay;
currencySign?: INumberFormatCurrencySign;
localeMatcher?: INumberFormatLocaleMatcher;
notation?: INumberForma... | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration | // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat
export type INumberFormatCompactDisplay = 'short' | 'long'; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatCurrency = string; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatCurrencyDisplay = 'symbol' | 'narrowSymbol' | 'code' | 'name'; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatCurrencySign = 'accounting' | 'standard'; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatLocaleMatcher = ILocaleMatcher; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatNotation = 'standard' | 'scientific' | 'engineering' | 'compact'; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatNumberingSystem = INumberingSystem; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatSignDisplay = 'auto' | 'never' | 'always' | 'exceptZero'; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatStyle = 'decimal' | 'currency' | 'percent' | 'unit'; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatUnit = string; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatUnitDisplay = 'long' | 'short' | 'narrow'; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
TypeAliasDeclaration |
export type INumberFormatValue = number | bigint; | lifaon74/common-classes | src/debug/observables-v5/i18n/number-format/number-format.type.ts | TypeScript |
ArrowFunction |
() => {
const { theme, setTheme } = useTheme()
const {
color: { bg, fg, primary, secondary },
} = theme
const setGrey = (
group: "bg" | "fg",
shade: keyof GreyScale,
color: string
) => {
if (theme.color[group][shade] !== color) {
const cpy = { ...theme }
cpy.color.name = "cus... | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(
group: "bg" | "fg",
shade: keyof GreyScale,
color: string
) => {
if (theme.color[group][shade] !== color) {
const cpy = { ...theme }
cpy.color.name = "custom"
cpy.color[group][shade] = color
setTheme(cpy)
}
} | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(
group: "primary" | "secondary",
shade: keyof ColorGradient,
color: string
) => {
if (theme.color[group][shade] !== color) {
const cpy = { ...theme }
cpy.color.name = "custom"
cpy.color[group][shade] = color
setTheme(cpy)
}
} | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setGrey("bg", "shade", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setGrey("bg", "base", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setGrey("bg", "surface", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setGrey("bg", "highlight", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setGrey("fg", "shade", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setGrey("fg", "base", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setGrey("fg", "surface", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setGrey("fg", "highlight", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setAccent("primary", "bg", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setAccent("primary", "base", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setAccent("primary", "fg", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setAccent("secondary", "bg", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) =>
setAccent("secondary", "base", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
ArrowFunction |
(value: string) => setAccent("secondary", "fg", value) | Heysaksham/yet-another-generic-startpage | src/Settings/Theme/fragments/PostColoring.tsx | TypeScript |
FunctionDeclaration |
export function useUserAddress(
fundingPotId: string | undefined,
colonyClient: ColonyClient | null
) {
const [userAddress, setUserAddress] = React.useState<string>();
useEffect(() => {
(async () => {
if (fundingPotId && colonyClient) {
const humanReadableFundingPot... | knoll3/betacolony-events-list | src/hooks/useUserAddress.ts | TypeScript |
ArrowFunction |
() => {
(async () => {
if (fundingPotId && colonyClient) {
const humanReadableFundingPotId = new utils.BigNumber(
fundingPotId
).toString();
const { associatedTypeId } = await colonyClient.getFundingPot(
humanRe... | knoll3/betacolony-events-list | src/hooks/useUserAddress.ts | TypeScript |
ArrowFunction |
async () => {
if (fundingPotId && colonyClient) {
const humanReadableFundingPotId = new utils.BigNumber(
fundingPotId
).toString();
const { associatedTypeId } = await colonyClient.getFundingPot(
humanReadableFundingPotI... | knoll3/betacolony-events-list | src/hooks/useUserAddress.ts | TypeScript |
FunctionDeclaration |
function createBaseGenesisState(): GenesisState {
return {
params: undefined,
gauges: [],
lockableDurations: [],
lastGaugeId: Long.UZERO,
};
} | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
ArrowFunction |
(e: any) => Gauge.fromJSON(e) | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
ArrowFunction |
(e: any) => Duration.fromJSON(e) | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
ArrowFunction |
(e) => (e ? Gauge.toJSON(e) : undefined) | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
ArrowFunction |
(e) =>
e ? Duration.toJSON(e) : undefined | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
ArrowFunction |
(e) => Gauge.fromPartial(e) | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
ArrowFunction |
(e) => Duration.fromPartial(e) | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
InterfaceDeclaration | /** GenesisState defines the incentives module's genesis state. */
export interface GenesisState {
/** params defines all the parameters of the module */
params?: Params;
gauges: Gauge[];
lockableDurations: Duration[];
lastGaugeId: Long;
} | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
MethodDeclaration |
encode(
message: GenesisState,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.params !== undefined) {
Params.encode(message.params, writer.uint32(10).fork()).ldelim();
}
for (const v of message.gauges) {
Gauge.encode(v!, writer.uint32(18).fork()).ldelim();
}
... | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
MethodDeclaration |
decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGenesisState();
while (reader.pos < end) {
const tag = r... | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
MethodDeclaration |
fromJSON(object: any): GenesisState {
return {
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
gauges: Array.isArray(object?.gauges)
? object.gauges.map((e: any) => Gauge.fromJSON(e))
: [],
lockableDurations: Array.isArray(object?.lockableDurations)
... | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
MethodDeclaration |
toJSON(message: GenesisState): unknown {
const obj: any = {};
message.params !== undefined &&
(obj.params = message.params ? Params.toJSON(message.params) : undefined);
if (message.gauges) {
obj.gauges = message.gauges.map((e) => (e ? Gauge.toJSON(e) : undefined));
} else {
obj.gauges... | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
MethodDeclaration |
fromPartial<I extends Exact<DeepPartial<GenesisState>, I>>(
object: I
): GenesisState {
const message = createBaseGenesisState();
message.params =
object.params !== undefined && object.params !== null
? Params.fromPartial(object.params)
: undefined;
message.gauges = object.gauge... | pyramation/osmosis-protobufs | src/proto/osmosis/incentives/genesis.ts | TypeScript |
InterfaceDeclaration | /**
* Interfaces for JSON returned from the ESPN API
*/
export interface IESPNLinkJSON {
text: string;
href: string;
rel: string[];
} | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface IESPNCompetitorsJSON {
score: any;
winner: boolean;
id: string;
team: {
abbreviation: string;
links: Array<IESPNLinkJSON>;
};
} | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface IESPNPastCompetitorsJSON extends IESPNCompetitorsJSON {
score: {
value: number;
displayValue: string;
};
} | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface IESPNCurrentCompetitorsJSON extends IESPNCompetitorsJSON {
score: string;
} | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface IESPNCompetitionJSON {
attendance: number;
boxscoreAvailable: boolean;
competitors: Array<any>;
date: string;
id: string;
neutralSite: boolean;
notes: Array<any>;
status: {
clock: number;
displayClock: string;
period: string;
type: {
... | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface IESPNScoreboardCompetitionJSON extends IESPNCompetitionJSON {
competitors: Array<IESPNPastCompetitorsJSON>;
} | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface IESPNCurrentCompetitionJSON extends IESPNCompetitionJSON {
competitors: Array<IESPNCurrentCompetitorsJSON>;
} | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface IESPNEvent {
competitions: Array<any>;
date: string;
id: number;
links: IESPNLinkJSON[];
name: string;
season: {
year: number;
displayName: string;
};
seasonType: {
id: string;
type: number;
name: string;
abbreviation: str... | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface IESPNPastEvent extends IESPNEvent {
competitions: Array<IESPNScoreboardCompetitionJSON>;
} | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface IESPNCurrentEvent extends IESPNEvent {
competitions: Array<IESPNCurrentCompetitionJSON>;
} | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface IESPNSchedule {
events: Array<IESPNPastEvent>;
requestedSeason: {
year: number;
type: number;
name: string;
displayName: string;
};
season: {
year: number;
type: number;
name: string;
displayName: string;
};
status... | jdk2pq/diduvawin | src/interfaces.ts | TypeScript |
ClassDeclaration | /**
* Injectable
*/
@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
/**
* Creates an instance of jwt strategy.
*/
constructor() {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
ignoreExpiration: true,
secretOrKey: 'super-secret-cat'... | asyncfinkd/career | server/src/auth/strategy/jwt.strategy.ts | TypeScript |
MethodDeclaration | /**
* Validates jwt strategy
* @param payload
* @returns
*/
async validate(payload: any) {
console.log('validate()', payload);
return payload;
} | asyncfinkd/career | server/src/auth/strategy/jwt.strategy.ts | TypeScript |
ArrowFunction |
({
schedules,
getSchedulesError,
isLoading,
getSchedules,
}) => {
const nextScheduleIndex = useMemo(() => {
let index = -1;
if (
!schedules.some((schedule, i) => {
if (isNotStartedSchedule(schedule)) {
index = i;
return true;
}
})
) {
index = ... | EntryDSM/poodle | poodle/src/components/Main/Main.tsx | TypeScript |
ArrowFunction |
() => {
let index = -1;
if (
!schedules.some((schedule, i) => {
if (isNotStartedSchedule(schedule)) {
index = i;
return true;
}
})
) {
index = 4;
}
return index;
} | EntryDSM/poodle | poodle/src/components/Main/Main.tsx | TypeScript |
ArrowFunction |
(schedule, i) => {
if (isNotStartedSchedule(schedule)) {
index = i;
return true;
}
} | EntryDSM/poodle | poodle/src/components/Main/Main.tsx | TypeScript |
ArrowFunction |
() => {
getSchedules();
} | EntryDSM/poodle | poodle/src/components/Main/Main.tsx | TypeScript |
ArrowFunction |
() => {
alert('오픈 기간이 아닙니다.');
window.history.back();
window.location.href = 'https://www.google.com/';
if (getSchedulesError.status) {
// alert(`Error code: ${getSchedulesError.status} 일정 불러오기 실패!`);
}
} | EntryDSM/poodle | poodle/src/components/Main/Main.tsx | TypeScript |
InterfaceDeclaration |
interface Props {
schedules: Schedule[];
getSchedulesError: ErrorType;
isLoading: boolean;
getSchedules: () => void;
} | EntryDSM/poodle | poodle/src/components/Main/Main.tsx | TypeScript |
ArrowFunction |
({timestamp, ...data}) => {
return {
id: recipientId,
time: timestamp,
messaging: [
{
timestamp,
sender: {id: senderId},
recipient: {id: recipientId},
...data,
},
],
} as EventEntry
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
ClassDeclaration |
export class EventBuilder extends Builder<WebhookEvent, EventBuilderData> {
from(senderId: string) {
return this.clone({senderId})
}
to(recipientId: string) {
return this.clone({recipientId})
}
at(timestamp: number) {
return this.clone({timestamp})
}
postback(title: string, payload?: strin... | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
TypeAliasDeclaration |
export type EventBuilderData = {
senderId?: string
recipientId?: string
timestamp: number
items: Array<MessageItem | PostbackItem | AccountLinkingItem>
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
TypeAliasDeclaration |
type MessageItem = {timestamp: number; message: MessageEvent} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
TypeAliasDeclaration |
type PostbackItem = {timestamp: number; postback: PostbackEvent} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
TypeAliasDeclaration |
type AccountLinkingItem = {timestamp: number; account_linking: AccountLinkingEvent} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
MethodDeclaration |
from(senderId: string) {
return this.clone({senderId})
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
MethodDeclaration |
to(recipientId: string) {
return this.clone({recipientId})
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
MethodDeclaration |
at(timestamp: number) {
return this.clone({timestamp})
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
MethodDeclaration |
postback(title: string, payload?: string) {
const mid = `m-${nextFakeMessageId++}`
const item = {timestamp: this.data.timestamp, postback: {mid, title, payload: payload || title}}
return this.clone({items: [...this.data.items, item]})
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
MethodDeclaration |
accountLinked(authorizationCode: string) {
const item: AccountLinkingItem = {
timestamp: this.data.timestamp,
account_linking: {status: 'linked', authorization_code: authorizationCode},
}
return this.clone({items: [...this.data.items, item]})
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
MethodDeclaration |
text(content: string) {
return this.message({text: content})
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
MethodDeclaration |
quickReply(text: string, payload?: string) {
return this.message({text, quick_reply: {payload: payload || text}})
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
MethodDeclaration |
replyTo(id: string, text: string) {
return this.message({text, reply_to: {mid: id}})
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
MethodDeclaration |
image(url: string) {
return this.attachment({type: 'image', payload: {url}})
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
MethodDeclaration |
audio(url: string) {
return this.attachment({type: 'audio', payload: {url}})
} | webNeat/messenger-chat | src/events/EventBuilder.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.