type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
() => {
const diagnostics = new Diagnostics();
const handler = new AssetTranslationHandler();
const translations: TranslationBundle[] = [];
const contents = Buffer.from('contents');
const sourceLocale = 'en-US';
handler.translate(
diagnostics, '/root/path', 'relative/path'... | 3V3R-3ST/angular | packages/localize/src/tools/test/translate/asset_files/asset_file_translation_handler_spec.ts | TypeScript |
InterfaceDeclaration |
export interface TaskCreationResultDto {
success: boolean,
task: TaskDto
} | popov-ea/learning-nestjs | src/task/dto/task-creation-result.dto.ts | TypeScript |
InterfaceDeclaration |
interface MPBase {
/** A Node.js package name that provides the maker or publisher functionality. */
name: string,
/** Overrides the platform that this maker or publisher will be used on. */
platforms?: ForgePlatform[] | null;
/** A maker or publisher specific configuration object, usually containing the `o... | Sachit71/WebCord | sources/code/build/forge.d.ts | TypeScript |
InterfaceDeclaration | // Maker types
interface MakerAppImage extends MPBase {
name: "electron-forge-maker-appimage",
config?: MakerAppImageConfig
} | Sachit71/WebCord | sources/code/build/forge.d.ts | TypeScript |
InterfaceDeclaration |
interface MakerDeb extends MPBase {
name: "@electron-forge/maker-deb";
config?: MakerDebConfig;
} | Sachit71/WebCord | sources/code/build/forge.d.ts | TypeScript |
InterfaceDeclaration |
interface MakerRpm extends MPBase {
name: "@electron-forge/maker-rpm",
config?: MakerRpmConfig
} | Sachit71/WebCord | sources/code/build/forge.d.ts | TypeScript |
InterfaceDeclaration | /*interface MakerSnap extends MPBase {
name: "@electron-forge/maker-snap",
config?: MakerSnapConfig
}
interface MakerFlatpak extends MPBase {
name: "@electron-forge/maker-flatpak",
config?: MakerFlatpakConfig
}*/
interface MakerZIP extends MPBase {
name: "@electron-forge/maker-zip",
config?: MakerZIPConfig... | Sachit71/WebCord | sources/code/build/forge.d.ts | TypeScript |
InterfaceDeclaration |
interface MakerDMG extends MPBase {
name: "@electron-forge/maker-dmg",
config?: MakerDMGConfig
} | Sachit71/WebCord | sources/code/build/forge.d.ts | TypeScript |
InterfaceDeclaration | // Publisher types
interface PublisherGitHub extends MPBase {
name: "@electron-forge/publisher-github",
config?: PublisherGitHubConfig
} | Sachit71/WebCord | sources/code/build/forge.d.ts | TypeScript |
TypeAliasDeclaration |
type Redeclare<I, M> = Omit<I, keyof M> & M; | Sachit71/WebCord | sources/code/build/forge.d.ts | TypeScript |
TypeAliasDeclaration | // Base types for makers / publishers
type MPConfig = unknown | {
/** Maker or publisher specific set of options. */
options?: unknown
} | Sachit71/WebCord | sources/code/build/forge.d.ts | TypeScript |
TypeAliasDeclaration | // Config type
export type ForgeConfigFile = Redeclare<Partial<ForgeConfig>, {
makers?: (
MakerZIP | MakerAppImage | MakerDeb | MakerRpm | MakerDMG //| MakerSnap | MakerFlatpak
)[];
publishers?: (
PublisherGitHub
)[];
}>; | Sachit71/WebCord | sources/code/build/forge.d.ts | TypeScript |
InterfaceDeclaration |
export interface FacadeBaseContext extends Koa.Context {
logger: Logger;
facade: Facade;
} | restorecommerce/libs | packages/facade/src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface FacadeModuleBase<TContext extends FacadeBaseContext = FacadeBaseContext> {
moduleName: string;
} | restorecommerce/libs | packages/facade/src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface FacadeModule<TContext extends FacadeBaseContext = FacadeBaseContext> extends FacadeModuleBase<TContext> {
(facade: Facade<[FacadeModule<TContext>]>): void;
} | restorecommerce/libs | packages/facade/src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface FacadeModuleFactory<TConfig = any, TContext extends FacadeBaseContext = FacadeBaseContext> extends FacadeModuleBase<TContext> {
(config: TConfig): FacadeModule<TContext>;
} | restorecommerce/libs | packages/facade/src/interfaces.ts | TypeScript |
InterfaceDeclaration |
export interface Facade<TModules extends FacadeModuleBase[] = []> {
readonly logger: Logger;
readonly koa: Koa<any, FacadeModulesContext<TModules>>;
readonly server?: Server;
readonly address?: string | AddressInfo;
readonly listening: boolean;
readonly env: string;
start(): Promise<void>;
onStart(fn: ... | restorecommerce/libs | packages/facade/src/interfaces.ts | TypeScript |
TypeAliasDeclaration |
type RequireAtLeastOne<T, Keys extends keyof T> =
Pick<T, Exclude<keyof T, Keys>> & {
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>
}[Keys]; | restorecommerce/libs | packages/facade/src/interfaces.ts | TypeScript |
TypeAliasDeclaration | // Extract module context
export type ExtractModuleContext<TModule> =
TModule extends FacadeModuleFactory<infer TConfig, infer TContext> ? TContext :
TModule extends FacadeModule<infer TContext> ? TContext :
never; | restorecommerce/libs | packages/facade/src/interfaces.ts | TypeScript |
TypeAliasDeclaration |
export type FacadeModulesContext<T extends FacadeModuleBase[]> = (T[0] extends FacadeModuleBase ? ExtractModuleContext<T[0]> : FacadeBaseContext) &
(T[1] extends FacadeModuleBase ? ExtractModuleContext<T[1]> : FacadeBaseContext) &
... | restorecommerce/libs | packages/facade/src/interfaces.ts | TypeScript |
TypeAliasDeclaration |
export type FacadeContext<T extends FacadeModuleBase[] | Facade<any> = []> =
T extends FacadeModuleBase[] ? FacadeModulesContext<T> :
T extends Facade<infer TFacadeModules> ? FacadeModulesContext<TFacadeModules> :
FacadeBaseContext; | restorecommerce/libs | packages/facade/src/interfaces.ts | TypeScript |
ArrowFunction | // DB Operation Success
() => {
console.log('Successfully add new admin account');
// eslint-disable-next-line no-process-exit
process.exit();
} | BusanDevelopers/BGM-Event-Calendar-API | src/utilsRunner/newAdmin.runner.ts | TypeScript |
ArrowFunction | // When DB Operation failed
error => {
console.error(error);
// eslint-disable-next-line no-process-exit
process.exit(1);
} | BusanDevelopers/BGM-Event-Calendar-API | src/utilsRunner/newAdmin.runner.ts | TypeScript |
ArrowFunction |
async (relayer: Relayer, tokenAddress?: string) => {
const name = 'name.mylogin.eth';
const [wallet] = await getWallets(relayer.provider);
const tokens = tokenAddress ? [tokenAddress, ETHER_NATIVE_TOKEN.address] : [ETHER_NATIVE_TOKEN.address];
const services = await createPreconfiguredServices(relayer.provider... | ensbot/ensbot-UniversalLogin-UniversalLoginSDK | universal-login-wallet/test/testhelpers/setupUI.tsx | TypeScript |
ArrowFunction |
(side) => {
const panel = panels[side];
return (
<WidgetPanel
key={side}
panel={panel}
spanBottom={panels.bottom.span}
spanTop={panels.top.span}
/> | rssahai/imodeljs | ui/ninezone/src/ui-ninezone/widget-panels/Panels.tsx | TypeScript |
InterfaceDeclaration | /** Properties of [[WidgetPanels]] component.
* @internal
*/
export interface WidgetPanelsProps extends CommonProps {
/** Content that is affected by pinned state of panels. */
children?: React.ReactNode;
/** Content that is always rendered as if panels are in a pinned state. */
centerContent?: React.ReactNod... | rssahai/imodeljs | ui/ninezone/src/ui-ninezone/widget-panels/Panels.tsx | TypeScript |
ClassDeclaration |
export class StoreMap extends Array<unknown> {
index = 0;
currentScope: Scope | null = null;
constructor() {
super();
if (typeof __RGH_DEVTOOLS__ !== 'undefined') {
__RGH_DEVTOOLS__.registerStoreMap(this);
}
}
} | dmaskasky/react-global-hooks | src/storeMap.ts | TypeScript |
ArrowFunction |
(charCode: number) => createInvertedIndexNode<number>(charCode) | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
test("inverted index node should be created with correct char code", () => {
const n = create(1);
expect(n.charCode).toBe(1);
});
test("inverted index node should be created with null next value", () => {
const n = create(1);
expect(n.next).toBeNull();
});
test("inverted index node ... | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const n = create(1);
expect(n.charCode).toBe(1);
} | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const n = create(1);
expect(n.next).toBeNull();
} | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const n = create(1);
expect(n.firstChild).toBeNull();
} | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const n = create(1);
expect(n.firstPosting).toBeNull();
} | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
test("empty children list should return undefined", () => {
const p = create(0);
expect(findInvertedIndexChildNodeByCharCode(p, 0)).toBeUndefined();
});
test("searching for an unexisting node should return undefined", () => {
const p = create(0);
const c1 = create(1);
const c2 = crea... | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const p = create(0);
expect(findInvertedIndexChildNodeByCharCode(p, 0)).toBeUndefined();
} | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const p = create(0);
const c1 = create(1);
const c2 = create(2);
addInvertedIndexChildNode(p, c1);
addInvertedIndexChildNode(p, c2);
expect(findInvertedIndexChildNodeByCharCode(p, 0)).toBeUndefined();
} | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const p = create(0);
const c1 = create(1);
const c2 = create(2);
addInvertedIndexChildNode(p, c1);
addInvertedIndexChildNode(p, c2);
expect(findInvertedIndexChildNodeByCharCode(p, 1)).toBe(c1);
expect(findInvertedIndexChildNodeByCharCode(p, 2)).toBe(c2);
} | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
test("empty trie should return undefined", () => {
const p = create(0);
expect(findInvertedIndexNode(p, "abc")).toBeUndefined();
});
test("searching for an unexisting node should return undefined", () => {
const p = create(0);
const a = create(97);
const b = create(98);
const c =... | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const p = create(0);
expect(findInvertedIndexNode(p, "abc")).toBeUndefined();
} | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const p = create(0);
const a = create(97);
const b = create(98);
const c = create(99);
addInvertedIndexChildNode(p, a);
addInvertedIndexChildNode(a, b);
addInvertedIndexChildNode(b, c);
expect(findInvertedIndexNode(p, "abc")).toBe(c);
} | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
test("should add one node", () => {
const n = create(0);
const p = {
next: null,
details: {
id: 0,
fieldLengths: [],
},
termFrequency: [],
};
addInvertedIndexPosting(n, p);
expect(n.firstPosting).toBe(p);
});
test("should add two nodes", () => ... | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const n = create(0);
const p = {
next: null,
details: {
id: 0,
fieldLengths: [],
},
termFrequency: [],
};
addInvertedIndexPosting(n, p);
expect(n.firstPosting).toBe(p);
} | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
ArrowFunction |
() => {
const n = create(0);
const p1 = {
next: null,
details: {
id: 0,
fieldLengths: [],
},
termFrequency: [],
};
const p2 = {
next: null,
details: {
id: 0,
fieldLengths: [],
},
termFrequency: [],
};
addInvertedInd... | rus0000/ndx | src/__tests__/inverted_index.spec.ts | TypeScript |
FunctionDeclaration |
export default function siblings(elem: Element): any[] {
const r = [];
let n = elem.parentNode?.firstChild;
for (; n; n = n.nextSibling) {
if (n.nodeType === 1 && n !== elem) {
r.push(n);
}
}
return r;
} | Sky-Sea-IOT/RabbitUI | src/dom-utils/siblings.ts | TypeScript |
ArrowFunction |
(config: APIGatewayClientConfig) => {
const browserDefaults = getBrowserRuntimeConfig(config);
return {
...browserDefaults,
...config,
runtime: "react-native",
sha256: config?.sha256 ?? Sha256,
};
} | christophgysin/aws-sdk-js-v3 | clients/client-api-gateway/runtimeConfig.native.ts | TypeScript |
ClassDeclaration | /**
* Incident Service payload for update requests.
*/
export class IncidentServiceUpdateData {
"attributes"?: IncidentServiceUpdateAttributes;
/**
* The incident service's ID.
*/
"id"?: string;
"relationships"?: IncidentServiceRelationships;
"type": IncidentServiceType;
"unparsedObject"?: any;
... | jeremypike15/datadog-api-client-typescript | packages/datadog-api-client-v2/models/IncidentServiceUpdateData.ts | TypeScript |
MethodDeclaration |
static getAttributeTypeMap() {
return IncidentServiceUpdateData.attributeTypeMap;
} | jeremypike15/datadog-api-client-typescript | packages/datadog-api-client-v2/models/IncidentServiceUpdateData.ts | TypeScript |
MethodDeclaration |
static deserialize(data: { [key: string]: any }): IncidentServiceUpdateData {
const res = new IncidentServiceUpdateData();
res.attributes = ObjectSerializer.deserialize(
data.attributes,
"IncidentServiceUpdateAttributes",
""
);
res.id = ObjectSerializer.deserialize(data.id, "string"... | jeremypike15/datadog-api-client-typescript | packages/datadog-api-client-v2/models/IncidentServiceUpdateData.ts | TypeScript |
MethodDeclaration |
static serialize(data: IncidentServiceUpdateData): { [key: string]: any } {
const attributeTypes = IncidentServiceUpdateData.getAttributeTypeMap();
const res: { [index: string]: any } = {};
for (const [key, value] of Object.entries(data)) {
if (!(key in attributeTypes)) {
throw new TypeError(... | jeremypike15/datadog-api-client-typescript | packages/datadog-api-client-v2/models/IncidentServiceUpdateData.ts | TypeScript |
FunctionDeclaration |
function pipeStdio(current: ExecProcess, other: Writable, stdout: boolean, stderr: boolean, extra1: boolean, extra2: boolean) {
if(stdout && current.stdout)
current.stdout.pipe(other);
if(stderr && current.stderr)
current.stderr.pipe(other);
if(extra1 && current.stdio[3])
current.stdio[3].pipe(other)... | JLChnToZ/essh | src/exec-process.ts | TypeScript |
FunctionDeclaration |
export function wrap(childProc: ChildProcess) {
return Object.assign(childProc, execProcessExtensions) as ExecProcess;
} | JLChnToZ/essh | src/exec-process.ts | TypeScript |
FunctionDeclaration |
export function extend(name: string, fn: (this: ExecProcess, ...args: any[]) => any) {
(execProcessExtensions as any)[name] = fn;
} | JLChnToZ/essh | src/exec-process.ts | TypeScript |
ArrowFunction |
(resolve, reject) =>
this.once('close', resolve).once('error', reject) | JLChnToZ/essh | src/exec-process.ts | TypeScript |
InterfaceDeclaration |
export interface ExecProcess extends ChildProcess, PromiseLike<number> {
pipe<T extends ChildProcess>(other: T, stdout?: boolean, stderr?: boolean, extra1?: boolean, extra2?: boolean): T;
pipe<T extends Writable>(other: T, stdout?: boolean, stderr?: boolean, extra1?: boolean, extra2?: boolean): T;
} | JLChnToZ/essh | src/exec-process.ts | TypeScript |
MethodDeclaration |
pipe(this: ExecProcess, other: ChildProcess | Writable, stdout = true, stderr = false, extra1 = false, extra2 = false) {
if(other instanceof Stream)
return pipeStdio(this, other as Writable, stdout, stderr, extra1, extra2);
if(other.stdin)
pipeStdio(this, other.stdin, stdout, stderr, extra1, extra2... | JLChnToZ/essh | src/exec-process.ts | TypeScript |
MethodDeclaration |
then(this: ExecProcess, onFulfilled, onRejected) {
return new Promise<number>((resolve, reject) =>
this.once('close', resolve).once('error', reject))
.then(onFulfilled, onRejected);
} | JLChnToZ/essh | src/exec-process.ts | TypeScript |
FunctionDeclaration |
export function App() {
const [selectedGenreId, setSelectedGenreId] = useState(1);
const [genres, setGenres] = useState<GenreResponseProps[]>([]);
const [movies, setMovies] = useState<MovieProps[]>([]);
const [selectedGenre, setSelectedGenre] = useState<GenreResponseProps>({} as GenreResponseProps);
useEf... | moraescodes/ignite-componentizando-a-aplicacao | src/App.tsx | TypeScript |
FunctionDeclaration |
function handleClickButton(id: number) {
setSelectedGenreId(id);
} | moraescodes/ignite-componentizando-a-aplicacao | src/App.tsx | TypeScript |
ArrowFunction |
() => {
api.get<MovieProps[]>(`movies/?Genre_id=${selectedGenreId}`).then(response => {
setMovies(response.data);
});
api.get<GenreResponseProps>(`genres/${selectedGenreId}`).then(response => {
setSelectedGenre(response.data);
})
} | moraescodes/ignite-componentizando-a-aplicacao | src/App.tsx | TypeScript |
ArrowFunction |
response => {
setSelectedGenre(response.data);
} | moraescodes/ignite-componentizando-a-aplicacao | src/App.tsx | TypeScript |
InterfaceDeclaration |
interface MovieProps {
Title: string;
Poster: string;
Ratings: Array<{
Source: string;
Value: string;
}>;
Runtime: string;
} | moraescodes/ignite-componentizando-a-aplicacao | src/App.tsx | TypeScript |
ArrowFunction |
() => {
this.searchbar.setFocus();
this.keyboard.show();
} | Thom212/phytosafe-app | src/pages/autocomplete/autocomplete.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'autocomplete',
templateUrl: 'autocomplete.html'
})
export class Autocomplete {
autocompleteItems: any;
autocompleteData: any;
autocompleteEntry: string;
@ViewChild(Searchbar) searchbar:Searchbar;
constructor (public viewCtrl: ViewController, public params: NavParams, public dia... | Thom212/phytosafe-app | src/pages/autocomplete/autocomplete.ts | TypeScript |
MethodDeclaration |
ionViewDidEnter() {
setTimeout(() => {
this.searchbar.setFocus();
this.keyboard.show();
});
} | Thom212/phytosafe-app | src/pages/autocomplete/autocomplete.ts | TypeScript |
MethodDeclaration | /**
* Fonction qui supprime la page modale ouverte, en passant comme valeur à la page initiale la valeur entrée par l'utilisateur.
* @method dismiss
* @param {} - aucun paramètre n'est passé à la fonction.
* @returns {} - aucune valeur n'est retournée par la fonction.
*/
dismiss() {
this.keyboard.clo... | Thom212/phytosafe-app | src/pages/autocomplete/autocomplete.ts | TypeScript |
MethodDeclaration | /**
* Fonction qui supprime la page modale ouverte, en passant comme valeur à la page initiale la valeur sélectionnée dans la liste proposée (autocompletion).
* @method chooseItem
* @param {any} - la valeur sélectionnée dans la liste proposée est passée à la fonction.
* @returns {} - aucune valeur n'est ret... | Thom212/phytosafe-app | src/pages/autocomplete/autocomplete.ts | TypeScript |
MethodDeclaration | /**
* Fonction qui, à chaque saisie de l'utilisateur, compare le contenu saisi et la liste proposée pour limiter la liste aux valeurs qui correspondent à la saisie : autocompletion.
* @method updateSearch
* @param {} - aucun paramètre n'est passé à la fonction.
* @returns {string} - une liste mise à jour su... | Thom212/phytosafe-app | src/pages/autocomplete/autocomplete.ts | TypeScript |
FunctionDeclaration |
function Demo() {
return (
<div style={{ maxWidth: 320, marginLeft: 'auto', marginRight: 'auto' }} | Anishpras/mantine | src/mantine-demos/src/demos/packages/Autocomplete/validation.tsx | TypeScript |
InterfaceDeclaration | /* tslint:disable */
export interface Occupancy {
/**
* Number of datapoints used for the value calculation.
*/
count: number;
/**
* Time of the latest report that was considered to calculate occupancy
*/
latestReport?: null | string;
/**
* Occupancy in percent.
*/
value: null | number;... | SAKPaaS/frontend | SAKPaaS/src/app/generated/models/occupancy.ts | TypeScript |
ClassDeclaration |
export class PDFSinglePageViewer extends BaseViewer {
constructor(options: any);
_previousPageNumber: any;
_shadowViewer: DocumentFragment | undefined;
_updateScrollDown: any;
_ensurePageViewVisible(): void;
} | HUYUANDONG/pdfjs-dist | types/web/pdf_single_page_viewer.d.ts | TypeScript |
MethodDeclaration |
_ensurePageViewVisible(): void; | HUYUANDONG/pdfjs-dist | types/web/pdf_single_page_viewer.d.ts | TypeScript |
ArrowFunction |
(event: any) => { this._handleMousemove(event); } | abiranjan/custom-angular-datepicker | app-demo/src/app/custom-angular-datepicker/datepicker/clock.ts | TypeScript |
ArrowFunction |
() => { this._handleMouseup(); } | abiranjan/custom-angular-datepicker | app-demo/src/app/custom-angular-datepicker/datepicker/clock.ts | TypeScript |
TypeAliasDeclaration |
export type ClockView = 'hour' | 'minute'; | abiranjan/custom-angular-datepicker | app-demo/src/app/custom-angular-datepicker/datepicker/clock.ts | TypeScript |
MethodDeclaration |
ngAfterContentInit() {
this.activeDate = this._activeDate || this._util.today();
this._init();
} | abiranjan/custom-angular-datepicker | app-demo/src/app/custom-angular-datepicker/datepicker/clock.ts | TypeScript |
MethodDeclaration | /** Handles mousedown events on the clock body. */
_handleMousedown(event: any) {
this.setTime(event);
document.addEventListener('mousemove', this.mouseMoveListener);
document.addEventListener('touchmove', this.mouseMoveListener);
document.addEventListener('mouseup', this.mouseUpListener);
document.... | abiranjan/custom-angular-datepicker | app-demo/src/app/custom-angular-datepicker/datepicker/clock.ts | TypeScript |
MethodDeclaration |
_handleMousemove(event: any) {
event.preventDefault();
this.setTime(event);
} | abiranjan/custom-angular-datepicker | app-demo/src/app/custom-angular-datepicker/datepicker/clock.ts | TypeScript |
MethodDeclaration |
_handleMouseup() {
document.removeEventListener('mousemove', this.mouseMoveListener);
document.removeEventListener('touchmove', this.mouseMoveListener);
document.removeEventListener('mouseup', this.mouseUpListener);
document.removeEventListener('touchend', this.mouseUpListener);
this.selectedChange... | abiranjan/custom-angular-datepicker | app-demo/src/app/custom-angular-datepicker/datepicker/clock.ts | TypeScript |
MethodDeclaration | /** Initializes this clock view. */
private _init() {
this._hours.length = 0;
this._minutes.length = 0;
let hourNames = this._locale.getHourNames();
let minuteNames = this._locale.getMinuteNames();
if (this.twelvehour) {
for (let i = 1; i < (hourNames.length / 2) + 1; i++) {
let radi... | abiranjan/custom-angular-datepicker | app-demo/src/app/custom-angular-datepicker/datepicker/clock.ts | TypeScript |
MethodDeclaration | /**
* Set Time
* @param event
*/
private setTime(event: any) {
let trigger = this._element.nativeElement;
let triggerRect = trigger.getBoundingClientRect();
let width = trigger.offsetWidth;
let height = trigger.offsetHeight;
let pageX = event.pageX !== undefined ? event.pageX : event.touche... | abiranjan/custom-angular-datepicker | app-demo/src/app/custom-angular-datepicker/datepicker/clock.ts | TypeScript |
ArrowFunction |
(movie) => movie.id === id | so0choi/nest-study | src/movies/movies.service.ts | TypeScript |
ArrowFunction |
(movie) => movie.id !== id | so0choi/nest-study | src/movies/movies.service.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class MoviesService {
private movies: Movie[] = [];
getAll(): Movie[] {
return this.movies;
}
getOne(id: number): Movie {
const movie = this.movies.find((movie) => movie.id === id); //convert string into number}
if (!movie) {
throw new NotFoundException(`Movie with ID $... | so0choi/nest-study | src/movies/movies.service.ts | TypeScript |
MethodDeclaration |
getAll(): Movie[] {
return this.movies;
} | so0choi/nest-study | src/movies/movies.service.ts | TypeScript |
MethodDeclaration |
getOne(id: number): Movie {
const movie = this.movies.find((movie) => movie.id === id); //convert string into number}
if (!movie) {
throw new NotFoundException(`Movie with ID ${id} not found`);
}
return movie;
} | so0choi/nest-study | src/movies/movies.service.ts | TypeScript |
MethodDeclaration |
deleteOne(id: number) {
this.getOne(id);
this.movies = this.movies.filter((movie) => movie.id !== id);
} | so0choi/nest-study | src/movies/movies.service.ts | TypeScript |
MethodDeclaration |
create(movieData: CreateMovieDto) {
this.movies.push({
id: this.movies.length + 1,
...movieData,
});
} | so0choi/nest-study | src/movies/movies.service.ts | TypeScript |
MethodDeclaration |
update(id: number, updateData: UpdateMovieDto) {
const movie = this.getOne(id);
this.deleteOne(id);
this.movies.push({ ...movie, ...updateData });
} | so0choi/nest-study | src/movies/movies.service.ts | TypeScript |
ArrowFunction |
() => {
React.useEffect(() => {
incModCount();
}, []);
return <div>
I'm component Comp_05_0698
<div>
</div>
</div>;
} | FredKSchott/scale-test | src/components/Comp_05_0698.tsx | TypeScript |
InterfaceDeclaration | /**
* Script represents a single script.
*/
export interface Script {
/** The content type */
url: string;
/** The content type */
redirectedUrl: string;
/** The content type */
contentType: string;
/** The source code of the script */
source: string;
/** The dependency import specifiers */
import... | kt3k/deps_info | types.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-factura-editar',
templateUrl: './factura-editar.component.html',
styleUrls: ['./factura-editar.component.css']
})
export class FacturaEditarComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
} | alejosb13/M-R-Cosmetics | src/app/pages/facturas/factura-editar/factura-editar.component.ts | TypeScript |
FunctionDeclaration |
export function checkPropClash(
parser: JSParser,
prop: AnyObjectMember | BindingObjectPatternProperty,
props: Set<string>,
): void {
if (prop.key.type === "ComputedPropertyKey" || prop.type === "ObjectMethod") {
return undefined;
}
const key = prop.key.value;
// We can only check these for collisions since... | halfnelson/rome | packages/@romejs/js-parser/parser/expression.ts | TypeScript |
FunctionDeclaration |
export function parseExpression(
parser: JSParser,
context: ExpressionContext,
noIn?: boolean,
refShorthandDefaultPos?: IndexTracker,
): AnyExpression {
const startPos = parser.state.startPos;
const expr = parseMaybeAssign(parser, context, noIn, refShorthandDefaultPos);
if (parser.match(tt.comma)) {
let expre... | halfnelson/rome | packages/@romejs/js-parser/parser/expression.ts | TypeScript |
FunctionDeclaration |
export function parseMaybeAssign<T extends AnyNode = AnyExpression>(
parser: JSParser,
context: ExpressionContext,
noIn?: boolean,
refShorthandDefaultPos?: IndexTracker,
afterLeftParse?: MaybeAssignAfterParse<T>,
refNeedsArrowPos?: IndexTracker,
): AnyExpression | T {
const branches = parser.createBranch<AnyExp... | halfnelson/rome | packages/@romejs/js-parser/parser/expression.ts | TypeScript |
FunctionDeclaration |
function _parseMaybeAssign<T extends AnyNode>(
parser: JSParser,
context: ExpressionContext,
noIn?: boolean,
refShorthandDefaultPos?: IndexTracker,
afterLeftParse?: MaybeAssignAfterParse<T>,
refNeedsArrowPos?: IndexTracker,
): AnyExpression | T {
const startPos = parser.state.startPos;
if (parser.isContextual... | halfnelson/rome | packages/@romejs/js-parser/parser/expression.ts | TypeScript |
FunctionDeclaration |
export function parseMaybeConditional(
parser: JSParser,
context: ExpressionContext,
noIn: undefined | boolean,
refShorthandDefaultPos: IndexTracker,
refNeedsArrowPos?: IndexTracker,
): AnyExpression {
const startPos = parser.state.startPos;
const potentialArrowAt = parser.state.potentialArrowAt;
const expr = ... | halfnelson/rome | packages/@romejs/js-parser/parser/expression.ts | TypeScript |
FunctionDeclaration |
export function tryParseConditionalConsequent(
parser: JSParser,
): {
consequent: AnyExpression;
failed: boolean;
} {
const brancher = parser.createBranch<{
consequent: AnyExpression;
failed: boolean;
}>();
brancher.add(() => {
parser.state.noArrowParamsConversionAt.push(parser.state.startPos.index);
co... | halfnelson/rome | packages/@romejs/js-parser/parser/expression.ts | TypeScript |
FunctionDeclaration |
export function parseConditional(
parser: JSParser,
expr: AnyExpression,
noIn: undefined | boolean,
startPos: Position,
refNeedsArrowPos?: IndexTracker,
): AnyExpression {
if (!parser.match(tt.question)) {
return expr;
}
// This is to handle a case like this: const foo = (foo?: bar) => {};
// We'll be cal... | halfnelson/rome | packages/@romejs/js-parser/parser/expression.ts | TypeScript |
FunctionDeclaration |
export function forwardNoArrowParamsConversionAt<T>(
parser: JSParser,
start: Position,
parse: () => T,
): T {
if (parser.state.noArrowParamsConversionAt.includes(start.index)) {
let result: T;
parser.state.noArrowParamsConversionAt.push(parser.state.startPos.index);
result = parse();
parser.state.noArrowP... | halfnelson/rome | packages/@romejs/js-parser/parser/expression.ts | TypeScript |
FunctionDeclaration |
function _parseConditional(
parser: JSParser,
expr: AnyExpression,
noIn: undefined | boolean,
startPos: Position,
): AnyExpression {
if (parser.eat(tt.question)) {
const test = expr;
const consequent = parseMaybeAssign(parser, "conditional consequent");
parser.expect(tt.colon);
const alternate = parseMayb... | halfnelson/rome | packages/@romejs/js-parser/parser/expression.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.