type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(): Promise<void> => ServiceDevices.getDevicesListAsync(zesp) .then(result => { dispatch(setDevices(result.devices)); if (result.zespVersion) dispatch(setZespFirmwareInstalledVersion(result.zespVersion)); })
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
result => { dispatch(setDevices(result.devices)); if (result.zespVersion) dispatch(setZespFirmwareInstalledVersion(result.zespVersion)); }
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
(): Promise<void> => ServiceRoot .getRootDataAsync(zesp) .then(reports => { dispatch(updateRootReports(reports)) console.debug("Root device reports updated"); })
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
reports => { dispatch(updateRootReports(reports)) console.debug("Root device reports updated"); }
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
(): Promise<void> => useZespSettings(zesp) .getCustomAsync<UiSettings>("zesp_ui") .then(settings => { const result = settings || UiDefaultSettings; dispatch(setUiSettings(result)) uiSettingsRef.current = result; })
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
settings => { const result = settings || UiDefaultSettings; dispatch(setUiSettings(result)) uiSettingsRef.current = result; }
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
(): void => { ServiceFirmware .getFirmwareInfoAsync(zesp) .then(firmwareInfo => { dispatch(setZespFirmwareInstalledVersion(firmwareInfo.currentVersion)); dispatch(setZespFirmwareUpdate(firmwareInfo.updatesInformation)); uiSettingsRef.current = {...uiSettingsRef.current, ...{firmwareUpdate: firmwareInfo.updatesInformation, firmwareLastCheck: Date.now()}}; useZespSettings(zesp).setCustom("zesp_ui", uiSettingsRef.current); dispatch(setUiSettings(uiSettingsRef.current)); console.debug("Firmware updates information loaded"); }) .catch(reason => { console.warn("Cannot read Firmware update information"); console.warn(reason); }); }
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
firmwareInfo => { dispatch(setZespFirmwareInstalledVersion(firmwareInfo.currentVersion)); dispatch(setZespFirmwareUpdate(firmwareInfo.updatesInformation)); uiSettingsRef.current = {...uiSettingsRef.current, ...{firmwareUpdate: firmwareInfo.updatesInformation, firmwareLastCheck: Date.now()}}; useZespSettings(zesp).setCustom("zesp_ui", uiSettingsRef.current); dispatch(setUiSettings(uiSettingsRef.current)); console.debug("Firmware updates information loaded"); }
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
reason => { console.warn("Cannot read Firmware update information"); console.warn(reason); }
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
(): Promise<void> => { const uiSettings = uiSettingsRef.current if (!uiSettings) throw new Error("Read UI settings before firmware checking"); if (uiSettings.firmwareUpdate && uiSettings.firmwareLastCheck && (Date.now() - uiSettings.firmwareLastCheck) < firmwareUpdateMinTimout) { dispatch(setZespFirmwareUpdate(uiSettings.firmwareUpdate)); console.debug("Firmware information read from settings"); return Promise.resolve(); } // run firmware loading in background _getFirmware(); return Promise.resolve(); }
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
(): Promise<void> => { const onReport = (ieee: string, reportKey: string, update: Partial<ZespReportInfo>) => dispatch(updateReport({ieee, reportKey, update})); ServiceUpdates.subscribeToEvents(zesp, onReport); return Promise.resolve(); }
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
(ieee: string, reportKey: string, update: Partial<ZespReportInfo>) => dispatch(updateReport({ieee, reportKey, update}))
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
(): Promise<void> => { const onUpdate = (devices: DeviceInfo[]): void => { // devices.pop(); dispatch(updateDevices(devices)); console.debug("Devices list updated"); } ServiceDevices.subscribeListUpdate(zesp, onUpdate); return Promise.resolve(); }
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
ArrowFunction
(devices: DeviceInfo[]): void => { // devices.pop(); dispatch(updateDevices(devices)); console.debug("Devices list updated"); }
NickRimmer/zesp-ui
src/shared/agents/ZespAgent.hook.tsx
TypeScript
TypeAliasDeclaration
/*! * Copyright Unlok, Vaughn Royko 2011-2019 * http://www.unlok.ca * * Credits & Thanks: * http://www.unlok.ca/credits-thanks/ * * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide: * https://waywardgame.github.io/ */ export declare type ICreditProperty = Map<string, number | undefined>;
WaywardGameKorean/addContents
mod-reference/definitions/npc/npcs/IMerchant.d.ts
TypeScript
TypeAliasDeclaration
export declare type ITalkedProperty = Map<string, boolean | undefined>;
WaywardGameKorean/addContents
mod-reference/definitions/npc/npcs/IMerchant.d.ts
TypeScript
ClassDeclaration
export class CLink extends CContainer<"a"> { public constructor(url?: string, view?: CElement<any>) { super("a"); if (view) this.addSubview(view); this.element.href = url || ""; } public set url(value: string) { this.element.href = value; } public get url(): string { return this.element.href; } public set target(value: CTarget) { this.element.target = value; } public get target(): CTarget { return this.element.target as CTarget; } }
element-ts/carbon
ts/CLink.ts
TypeScript
FunctionDeclaration
async function hearingRequirementsMiddleware(req: Request, res: Response, next: NextFunction) { const hearingRequirementsEnabled: boolean = await LaunchDarklyService.getInstance().getVariation(req, FEATURE_FLAGS.HEARING_REQUIREMENTS, false); if (hearingRequirementsEnabled) { return next(); } else { return res.redirect(paths.common.overview); } }
hmcts/ia-aip-frontend-tmp
app/middleware/hearing-requirements-middleware.ts
TypeScript
FunctionDeclaration
async function hearingBundleFeatureMiddleware(req: Request, res: Response, next: NextFunction) { const hearingBundleFeatureEnabled: boolean = await LaunchDarklyService.getInstance().getVariation(req, FEATURE_FLAGS.HEARING_BUNDLE, false); req.app.locals.logger.trace(`Hearing Bundle Feature Flag = ${JSON.stringify(hearingBundleFeatureEnabled)}`, 'Hearing Bundle Feature Flag'); if (hearingBundleFeatureEnabled) { return next(); } else { return res.redirect(paths.common.overview); } }
hmcts/ia-aip-frontend-tmp
app/middleware/hearing-requirements-middleware.ts
TypeScript
ClassDeclaration
@Component({ selector: 'confirm-dialog', templateUrl: './confirm-dialog.component.html', }) export class ConfirmDialogComponent { constructor( public dialogRef: MatDialogRef<ConfirmDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: any) { } onNoClick(): void { this.dialogRef.close(); } }
anishsharma8/ASW-Form-Builder
src/app/layout/shared-components/confirm-dialog/confirm-dialog.component.ts
TypeScript
MethodDeclaration
onNoClick(): void { this.dialogRef.close(); }
anishsharma8/ASW-Form-Builder
src/app/layout/shared-components/confirm-dialog/confirm-dialog.component.ts
TypeScript
ArrowFunction
(e: any) => { e.preventDefault(); window.close(); }
NosCoreLegend/Launcher
src/menu-bar/menu-bar.tsx
TypeScript
ClassDeclaration
export class MenuBar extends React.Component<LoginComponentProps, {}> { handleClose = (e: any) => { e.preventDefault(); window.close(); } render() { return ( <Fragment> <nav className={styles.menu} role='navigation'> <ul> <li><LoginComponent {...this.props} /></li> <li className={styles.closeLogo}> <FaTimes onClick={this.handleClose} /> </li> <li className={styles.optionLogo}> <ConfigurationComponent /> </li> </ul> </nav> </Fragment> ); } }
NosCoreLegend/Launcher
src/menu-bar/menu-bar.tsx
TypeScript
MethodDeclaration
render() { return ( <Fragment> <nav className={styles.menu} role='navigation'> <ul> <li><LoginComponent {...this.props} /></li> <li className={styles.closeLogo}> <FaTimes onClick={this.handleClose} /> </li> <li className={styles.optionLogo}> <ConfigurationComponent /> </li> </ul> </nav> </Fragment> ); }
NosCoreLegend/Launcher
src/menu-bar/menu-bar.tsx
TypeScript
ClassDeclaration
@Controller('api') @ApiTags('authorization') export class AuthController { constructor(private readonly _authService: AuthService) {} @Post('login') @HttpCode(HttpStatus.OK) @ApiOperation({ description: 'sign in account' }) @ApiResponse({ status: 200, description: 'login:success' }) @ApiResponse({ status: 403, description: 'you have entered incorrect password', type: ForbiddenException }) @ApiResponse({ status: 404, description: 'user not found', type: NotFoundException }) @ApiBody({ type: AuthDto }) public async signIn(@Body() authData: AuthDto): Promise<AuthResponseMessageDto> { return await this._authService.signIn(authData); } @Post('register') @HttpCode(HttpStatus.CREATED) @UseGuards(DoesLoginExistGuard) @ApiOperation({ description: 'create new account' }) @ApiResponse({ status: 201, description: 'register:success' }) @ApiResponse({ status: 400, description: 'Bad Request', type: BadRequestException }) @ApiResponse({ status: 403, description: 'this login already exist', type: ForbiddenException }) @ApiBody({ type: CreateUserDto }) async signUp(@Body() user: CreateUserDto): Promise<ResponseMessageDto> { return await this._authService.signUp(user); } @Post('forgot_password') @HttpCode(HttpStatus.CREATED) @UseGuards(AuthTokenGuard) @ApiBearerAuth() @ApiOperation({ description: 'change user password' }) @ApiResponse({ status: 201, description: 'change password:success' }) @ApiResponse({ status: 400, description: 'Bad Request', type: BadRequestException }) @ApiResponse({ status: 401, description: 'invalid authorization headers', type: UnauthorizedException }) @ApiBody({ type: NewPasswordDto }) async changePassword(@Headers() headers: IncomingHttpHeaders, @Body() newPassword: NewPasswordDto): Promise<ResponseMessageDto> { return await this._authService.changePassword(headers['authorization'], newPassword); } }
Eyhenij/nest-users
src/modules/auth/auth.controller.ts
TypeScript
MethodDeclaration
@Post('login') @HttpCode(HttpStatus.OK) @ApiOperation({ description: 'sign in account' }) @ApiResponse({ status: 200, description: 'login:success' }) @ApiResponse({ status: 403, description: 'you have entered incorrect password', type: ForbiddenException }) @ApiResponse({ status: 404, description: 'user not found', type: NotFoundException }) @ApiBody({ type: AuthDto }) public async signIn(@Body() authData: AuthDto): Promise<AuthResponseMessageDto> { return await this._authService.signIn(authData); }
Eyhenij/nest-users
src/modules/auth/auth.controller.ts
TypeScript
MethodDeclaration
@Post('register') @HttpCode(HttpStatus.CREATED) @UseGuards(DoesLoginExistGuard) @ApiOperation({ description: 'create new account' }) @ApiResponse({ status: 201, description: 'register:success' }) @ApiResponse({ status: 400, description: 'Bad Request', type: BadRequestException }) @ApiResponse({ status: 403, description: 'this login already exist', type: ForbiddenException }) @ApiBody({ type: CreateUserDto }) async signUp(@Body() user: CreateUserDto): Promise<ResponseMessageDto> { return await this._authService.signUp(user); }
Eyhenij/nest-users
src/modules/auth/auth.controller.ts
TypeScript
MethodDeclaration
@Post('forgot_password') @HttpCode(HttpStatus.CREATED) @UseGuards(AuthTokenGuard) @ApiBearerAuth() @ApiOperation({ description: 'change user password' }) @ApiResponse({ status: 201, description: 'change password:success' }) @ApiResponse({ status: 400, description: 'Bad Request', type: BadRequestException }) @ApiResponse({ status: 401, description: 'invalid authorization headers', type: UnauthorizedException }) @ApiBody({ type: NewPasswordDto }) async changePassword(@Headers() headers: IncomingHttpHeaders, @Body() newPassword: NewPasswordDto): Promise<ResponseMessageDto> { return await this._authService.changePassword(headers['authorization'], newPassword); }
Eyhenij/nest-users
src/modules/auth/auth.controller.ts
TypeScript
ArrowFunction
(content) => { this.content = content.eula; }
akariv/datacity-businessgate
ui/projects/businessgate/src/app/widgets/widget-sidepage-eula/widget-sidepage-eula.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-widget-sidepage-eula', templateUrl: './widget-sidepage-eula.component.html', styleUrls: ['./widget-sidepage-eula.component.less'] }) export class WidgetSidepageEulaComponent implements OnInit { content: any = {content: ''}; marked = marked; constructor(private data: DataService) { this.data.content.pipe(first()) .subscribe((content) => { this.content = content.eula; }); } ngOnInit(): void { } }
akariv/datacity-businessgate
ui/projects/businessgate/src/app/widgets/widget-sidepage-eula/widget-sidepage-eula.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { }
akariv/datacity-businessgate
ui/projects/businessgate/src/app/widgets/widget-sidepage-eula/widget-sidepage-eula.component.ts
TypeScript
ArrowFunction
(response) => { console.log('Questions', response); this.questions = response; this.resultQuestion = response; console.log('resultedQuestions', this.resultQuestion); this.setPage(1); }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
ArrowFunction
(error) => { alert(error); }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
ArrowFunction
(response) =>{ console.log('Answers', response); this.answers = response; this.loading = false; }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
ArrowFunction
(error) =>{ alert(error); }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
ArrowFunction
(response) =>{ console.log('UpdatedResponse', response); alert('Updated succesfully.'); this.mode = 'general'; }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
ArrowFunction
(error)=>{ alert(error); }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
ArrowFunction
(response) =>{ console.log('updated Answers', response); alert('Answers Succesfully Updated'); this.mode = 'general'; this.display = false; }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
ClassDeclaration
@Component({ moduleId: module.id.toString(), selector: 'editQ.component', templateUrl: 'editQ.component.html', providers: [EditQService] }) export class EditQComponent implements OnInit { quickAnswerEdit: AnswerEditModel = new AnswerEditModel(); quickQuestionEdit: QuestionEditModel = new QuestionEditModel(); quickQuestion: QuestionModel = new QuestionModel(); display: boolean = false; currentUser: User; loading = false; selectedQuestion: any; questions = []; answers = []; mode = 'general'; resultQuestion : Quote; editPqqId: any; editNo: any; editHeader: any; editNarration: any; editPassage: any; questionPager: any = {}; // paged items questionPagedItems: any[]; constructor( private router: Router, private pagerService: PagerService, private alertService: AlertService, private _editquestionService: EditQService ) { this.currentUser = JSON.parse(localStorage.getItem('currentUser')); } ngOnInit() { this.selectedQuestion = this._editquestionService.getQuiz() console.log('SelectedQuestion', this.selectedQuestion); this.getQuestion(); } showDialog() { this.display = true; } //////////////// ///////////////// Setting Paged items for questions setPage(page: number) { if (page < 1 || page > this.questionPager.totalPages) { return; } // get pager object from service this.questionPager = this.pagerService.getPager(this.questions.length, page); // get current page of items this.questionPagedItems = this.questions.slice(this.questionPager.startIndex, this.questionPager.endIndex + 1); } getQuestion() { this._editquestionService.getQustions(this.selectedQuestion.pqh_id) .subscribe((response) => { console.log('Questions', response); this.questions = response; this.resultQuestion = response; console.log('resultedQuestions', this.resultQuestion); this.setPage(1); }, (error) => { alert(error); }); this.mode = 'general'; } onSelect(pqq_id: any){ this.loading = true; console.log('Onselect', pqq_id); this._editquestionService.getAnswers(pqq_id) .subscribe((response) =>{ console.log('Answers', response); this.answers = response; this.loading = false; }, (error) =>{ alert(error); }); } editQuestion(pqq_id: any, no: any, header: any, narration:any, passage: any){ console.log('TobeEdited', pqq_id); console.log('No', no); this.editPqqId = pqq_id; this.editNo = no; this.editHeader = header; this.editNarration = narration; this.editPassage = passage; this.quickQuestionEdit.passage_header = header; this.quickQuestionEdit.question_narration = narration; this.quickQuestionEdit.question_passage = passage; // this.resultQuestion = this.questions this.mode = 'edit'; } updateSubmit(){ this.quickQuestionEdit.modified_by = this.currentUser.surname; this.quickQuestionEdit.pqh_id = this.selectedQuestion.pqh_id; this.quickQuestionEdit.pqq_id = this.editPqqId; this.quickQuestionEdit.question_sequence = this.editNo; console.log('Updataed Results', this.quickQuestionEdit); this._editquestionService.updateQuestion(this.quickQuestionEdit) .subscribe((response) =>{ console.log('UpdatedResponse', response); alert('Updated succesfully.'); this.mode = 'general'; }, (error)=>{ alert(error); }); } editAnswers(ans_pqq: any, ans_pqa:any, ans_id: any, ans_narration:any, ans_correct: any, ans_explanation ){ this.quickAnswerEdit.pqa_id = ans_pqa; this.quickAnswerEdit.answer_id = ans_id; this.quickAnswerEdit.pqq_id = ans_pqq; this.quickAnswerEdit.correct_yn_explanation = ans_explanation; this.quickAnswerEdit.correct_yn = ans_correct; this.quickAnswerEdit.answer_narration = ans_narration; console.log('QuickAnswerEdit', this.quickAnswerEdit); this.mode = 'answeredit'; } answerUpdate(){ console.log('LastUpdatedAnswer', this.quickAnswerEdit); this._editquestionService.updateAnswers(this.quickAnswerEdit) .subscribe((response) =>{ console.log('updated Answers', response); alert('Answers Succesfully Updated'); this.mode = 'general'; this.display = false; }, (error)=>{ alert(error); }) } }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
MethodDeclaration
ngOnInit() { this.selectedQuestion = this._editquestionService.getQuiz() console.log('SelectedQuestion', this.selectedQuestion); this.getQuestion(); }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
MethodDeclaration
showDialog() { this.display = true; }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
MethodDeclaration
//////////////// ///////////////// Setting Paged items for questions setPage(page: number) { if (page < 1 || page > this.questionPager.totalPages) { return; } // get pager object from service this.questionPager = this.pagerService.getPager(this.questions.length, page); // get current page of items this.questionPagedItems = this.questions.slice(this.questionPager.startIndex, this.questionPager.endIndex + 1); }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
MethodDeclaration
getQuestion() { this._editquestionService.getQustions(this.selectedQuestion.pqh_id) .subscribe((response) => { console.log('Questions', response); this.questions = response; this.resultQuestion = response; console.log('resultedQuestions', this.resultQuestion); this.setPage(1); }, (error) => { alert(error); }); this.mode = 'general'; }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
MethodDeclaration
onSelect(pqq_id: any){ this.loading = true; console.log('Onselect', pqq_id); this._editquestionService.getAnswers(pqq_id) .subscribe((response) =>{ console.log('Answers', response); this.answers = response; this.loading = false; }, (error) =>{ alert(error); }); }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
MethodDeclaration
editQuestion(pqq_id: any, no: any, header: any, narration:any, passage: any){ console.log('TobeEdited', pqq_id); console.log('No', no); this.editPqqId = pqq_id; this.editNo = no; this.editHeader = header; this.editNarration = narration; this.editPassage = passage; this.quickQuestionEdit.passage_header = header; this.quickQuestionEdit.question_narration = narration; this.quickQuestionEdit.question_passage = passage; // this.resultQuestion = this.questions this.mode = 'edit'; }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
MethodDeclaration
updateSubmit(){ this.quickQuestionEdit.modified_by = this.currentUser.surname; this.quickQuestionEdit.pqh_id = this.selectedQuestion.pqh_id; this.quickQuestionEdit.pqq_id = this.editPqqId; this.quickQuestionEdit.question_sequence = this.editNo; console.log('Updataed Results', this.quickQuestionEdit); this._editquestionService.updateQuestion(this.quickQuestionEdit) .subscribe((response) =>{ console.log('UpdatedResponse', response); alert('Updated succesfully.'); this.mode = 'general'; }, (error)=>{ alert(error); }); }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
MethodDeclaration
editAnswers(ans_pqq: any, ans_pqa:any, ans_id: any, ans_narration:any, ans_correct: any, ans_explanation ){ this.quickAnswerEdit.pqa_id = ans_pqa; this.quickAnswerEdit.answer_id = ans_id; this.quickAnswerEdit.pqq_id = ans_pqq; this.quickAnswerEdit.correct_yn_explanation = ans_explanation; this.quickAnswerEdit.correct_yn = ans_correct; this.quickAnswerEdit.answer_narration = ans_narration; console.log('QuickAnswerEdit', this.quickAnswerEdit); this.mode = 'answeredit'; }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
MethodDeclaration
answerUpdate(){ console.log('LastUpdatedAnswer', this.quickAnswerEdit); this._editquestionService.updateAnswers(this.quickAnswerEdit) .subscribe((response) =>{ console.log('updated Answers', response); alert('Answers Succesfully Updated'); this.mode = 'general'; this.display = false; }, (error)=>{ alert(error); }) }
danielpiyo/mitihani
src/app/editquestion/editQ.component.ts
TypeScript
ArrowFunction
(team) => teamID === team.id
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
ArrowFunction
(player) => id === player.id
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
EnumDeclaration
enum Mode { New = 'New', EditActive = 'EditActive', EditOther = 'EditOther', Duplicate = 'Duplicate', }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
updateRunData(state, { value }): void { Vue.set(state, 'runData', clone(value)); Vue.set(state, 'updateTwitch', false); }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
updateMode(state, { value }): void { Vue.set(state, 'mode', value); }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
updateTwitch(state, { value }): void { Vue.set(state, 'updateTwitch', value); }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
setAsDuplicate(state): void { Vue.set(state, 'prevID', state.runData.id); Vue.set(state.runData, 'id', uuid()); }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
setPreviousRunID(state, { value }): void { Vue.set(state, 'prevID', value); }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
resetRunData(state): void { Vue.set(state, 'runData', clone(defaultRunData)); if (repStore.state.defaultSetupTime) { // Fill in default setup time if available. Vue.set(state.runData, 'setupTimeS', repStore.state.defaultSetupTime); Vue.set(state.runData, 'setupTime', msToTimeStr( repStore.state.defaultSetupTime * 1000, )); } Vue.set(state.runData, 'id', uuid()); Vue.set(state, 'updateTwitch', false); }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
addNewTeam(state): void { const teamData = clone(defaultTeam); teamData.id = uuid(); // Adds an empty player as well for ease of use. const playerData = clone(defaultPlayer); playerData.id = uuid(); playerData.teamID = teamData.id; teamData.players.push(playerData); state.runData.teams.push(teamData); }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
addNewPlayer(state, { teamID }): void { const teamIndex = state.runData.teams.findIndex((team) => teamID === team.id); if (teamIndex >= 0) { const data = clone(defaultPlayer); data.id = uuid(); data.teamID = teamID; state.runData.teams[teamIndex].players.push(data); } }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
removeTeam(state, { teamID }): void { const teamIndex = state.runData.teams.findIndex((team) => teamID === team.id); if (teamIndex >= 0) { state.runData.teams.splice(teamIndex, 1); } }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
removePlayer(state, { teamID, id }): void { const teamIndex = state.runData.teams.findIndex((team) => teamID === team.id); const playerIndex = (teamIndex >= 0) ? state.runData.teams[teamIndex].players.findIndex((player) => id === player.id) : -1; if (teamIndex >= 0 && playerIndex >= 0) { state.runData.teams[teamIndex].players.splice(playerIndex, 1); } }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
MethodDeclaration
async saveRunData({ state }): Promise<boolean> { const noTwitchGame = await nodecg.sendMessage('modifyRun', { runData: state.runData, prevID: state.prevID, updateTwitch: state.updateTwitch, }); Vue.set(state, 'prevID', undefined); Vue.set(state, 'updateTwitch', false); return noTwitchGame; }
Seuhn/nodecg-speedcontrol
src/dashboard/run-modification-dialog/store.ts
TypeScript
ArrowFunction
(namePath: string) => namePath .replace(/\.\./g, '') .replace(/(\\|\/)/g, '/') .replace(/[-.$:]/g, `_${uuid++}_`) .replace(/(\/(\w))/g, m => m.toUpperCase()) .replace(/(\/(\w))/g, '$2')
FringeY/alibabacloud-console-design
packages/console-toolkit-plugin-xconsole-fs-route/src/utils/utils.ts
TypeScript
ArrowFunction
m => m.toUpperCase()
FringeY/alibabacloud-console-design
packages/console-toolkit-plugin-xconsole-fs-route/src/utils/utils.ts
TypeScript
ClassDeclaration
export declare class UserController { private readonly userService; constructor(userService: UserService); create(user: CreatedUserDto): void; findAll(): Promise<User[]>; findOne(id: number): Promise<User>; update(id: number, user: UpdatedUserDto): Promise<{ message: string; }>; delete(id: number): Promise<{ message: string; }>; }
cristinaparasca/AnotherNest
dist/users/users.controller.d.ts
TypeScript
MethodDeclaration
create(user: CreatedUserDto): void;
cristinaparasca/AnotherNest
dist/users/users.controller.d.ts
TypeScript
MethodDeclaration
findAll(): Promise<User[]>;
cristinaparasca/AnotherNest
dist/users/users.controller.d.ts
TypeScript
MethodDeclaration
findOne(id: number): Promise<User>;
cristinaparasca/AnotherNest
dist/users/users.controller.d.ts
TypeScript
MethodDeclaration
update(id: number, user: UpdatedUserDto): Promise<{ message: string; }>;
cristinaparasca/AnotherNest
dist/users/users.controller.d.ts
TypeScript
MethodDeclaration
delete(id: number): Promise<{ message: string; }>;
cristinaparasca/AnotherNest
dist/users/users.controller.d.ts
TypeScript
FunctionDeclaration
export default function AddTagTermModal({ globalTags, glossaryTerms, visible, onClose, entityUrn, entityType, entitySubresource, type = EntityType.Tag, }: AddTagModalProps) { const [getAutoCompleteResults, { loading, data: suggestionsData }] = useGetAutoCompleteMultipleResultsLazyQuery({ fetchPolicy: 'no-cache', }); const [inputValue, setInputValue] = useState(''); const [selectedValue, setSelectedValue] = useState(''); const [showCreateModal, setShowCreateModal] = useState(false); const [disableAdd, setDisableAdd] = useState(false); const entityRegistry = useEntityRegistry(); const [addTagMutation] = useAddTagMutation(); const [addTermMutation] = useAddTermMutation(); const autoComplete = (query: string) => { if (query && query !== '') { getAutoCompleteResults({ variables: { input: { types: [type], query, }, }, }); } }; const options = suggestionsData?.autoCompleteForMultiple?.suggestions.flatMap((entity: AutoCompleteResultForEntity) => entity.suggestions.map((suggestion: string) => renderItem(suggestion, entityRegistry.getIcon(entity.type, 14, IconStyleType.TAB_VIEW), entity.type), ), ) || []; const inputExistsInAutocomplete = options.some((option) => option.value.toLowerCase() === inputValue.toLowerCase()); const autocompleteOptions = options.map((option) => ( <Select.Option value={`${option.value}${NAME_TYPE_SEPARATOR}${option.type}`}
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
(rawValue: string) => { const [name, type] = rawValue.split(NAME_TYPE_SEPARATOR); return { name, type, }; }
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
(suggestion: string, icon: JSX.Element, type: string) => ({ value: suggestion, label: ( <SuggestionContainer> <span>{icon}</span> <SuggestionText>{suggestion}</SuggestionText> </SuggestionContainer> ), type, })
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
(query: string) => { if (query && query !== '') { getAutoCompleteResults({ variables: { input: { types: [type], query, }, }, }); } }
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
(entity: AutoCompleteResultForEntity) => entity.suggestions.map((suggestion: string) => renderItem(suggestion, entityRegistry.getIcon(entity.type, 14, IconStyleType.TAB_VIEW), entity.type), )
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
(suggestion: string) => renderItem(suggestion, entityRegistry.getIcon(entity.type, 14, IconStyleType.TAB_VIEW), entity.type)
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
(option) => option.value.toLowerCase() === inputValue.toLowerCase()
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
(option) => ( <Select.Option value={`${option.value}${NAME_TYPE_SEPARATOR}${option.type}`
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
() => { const { name: selectedName, type: selectedType } = getSelectedValue(selectedValue); let mutation: ((input: any) => Promise<any>) | null = null; if (selectedType === EntityType.Tag) { mutation = addTagMutation; if (globalTags?.tags?.some((tag) => tag.tag.name === selectedName)) { onClose(); return; } } if (selectedType === EntityType.GlossaryTerm) { mutation = addTermMutation; if (glossaryTerms?.terms?.some((term) => term.term.name === selectedName)) { onClose(); return; } } if (!entityUrn || !mutation) { onClose(); return; } setDisableAdd(true); let urnToAdd = ''; let input = {}; if (selectedType === EntityType.Tag) { urnToAdd = `urn:li:tag:${selectedName}`; input = { tagUrn: urnToAdd, targetUrn: entityUrn, subResource: entitySubresource, }; } if (selectedType === EntityType.GlossaryTerm) { urnToAdd = `urn:li:glossaryTerm:${selectedName}`; input = { termUrn: urnToAdd, targetUrn: entityUrn, subResource: entitySubresource, }; } analytics.event({ type: EventType.EntityActionEvent, actionType: EntityActionType.UpdateTags, entityType, entityUrn, }); mutation({ variables: { input, }, }) .then(({ errors }) => { if (!errors) { message.success({ content: 'Added!', duration: 2 }); } }) .catch((e) => { message.destroy(); message.error({ content: `Failed to add: \n ${e.message || ''}`, duration: 3 }); }) .finally(() => { setDisableAdd(false); onClose(); }); }
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
(tag) => tag.tag.name === selectedName
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
(term) => term.term.name === selectedName
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
({ errors }) => { if (!errors) { message.success({ content: 'Added!', duration: 2 }); } }
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
(e) => { message.destroy(); message.error({ content: `Failed to add: \n ${e.message || ''}`, duration: 3 }); }
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ArrowFunction
() => { setDisableAdd(false); onClose(); }
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
TypeAliasDeclaration
type AddTagModalProps = { globalTags?: GlobalTags | null; glossaryTerms?: GlossaryTerms | null; visible: boolean; onClose: () => void; entityUrn: string; entityType: EntityType; entitySubresource?: string; type?: EntityType; };
LJMichale/datahub
datahub-web-react/src/app/shared/tags/AddTagTermModal.tsx
TypeScript
ClassDeclaration
@NgModule({ imports: [BrowserModule, FormsModule], declarations: [AppComponent], entryComponents: [AppComponent], bootstrap: [], // Don't bootstrap any component statically (see ngDoBootstrap() below) providers: [], }) export class AppModule { // Avoid bootstraping any component statically because we need to attach to // the portlet's DOM, which is different for each portlet instance and, // thus, cannot be determined until the page is rendered (during runtime). ngDoBootstrap() {} }
JTrudell2/Examples
gradle/apps/npm-deduplication-portlets/angular/angular-consumer-portlet/src/main/resources/META-INF/resources/lib/app/app.module.ts
TypeScript
MethodDeclaration
// Avoid bootstraping any component statically because we need to attach to // the portlet's DOM, which is different for each portlet instance and, // thus, cannot be determined until the page is rendered (during runtime). ngDoBootstrap() {}
JTrudell2/Examples
gradle/apps/npm-deduplication-portlets/angular/angular-consumer-portlet/src/main/resources/META-INF/resources/lib/app/app.module.ts
TypeScript
FunctionDeclaration
function StoragePage() { // base path for images const { basePath } = useRouter() const meta_title = 'Storage | Store any digital content' const meta_description = 'An open source Object store with unlimited scalability, for any file type.' return ( <> <NextSeo title={meta_title} description={meta_description} openGraph={{ title: meta_title, description: meta_description, url: `https://supabase.com/storage`, images: [ { url: `https://supabase.com${basePath}/images/product/storage/storage-og.jpg`, }, ], }}
DukeManh/supabase
www/pages/storage/Storage.tsx
TypeScript
TypeAliasDeclaration
type of digital
DukeManh/supabase
www/pages/storage/Storage.tsx
TypeScript
MethodDeclaration
serve <br
DukeManh/supabase
www/pages/storage/Storage.tsx
TypeScript
MethodDeclaration
app <
DukeManh/supabase
www/pages/storage/Storage.tsx
TypeScript
MethodDeclaration
soon! <
DukeManh/supabase
www/pages/storage/Storage.tsx
TypeScript
FunctionDeclaration
export function createControlHook<E extends any, P extends ControlOptions>( useElement: ElementHook<E, P>, ) { return function useNgwMapControl(props: P): ReturnType<ElementHook<E, P>> { const context = useNgwMapContext(); const elementRef = useElement(props, context); const { instance } = elementRef.current; // const positionRef = useRef(props.position); const position = props.position || 'top-left'; useEffect( function addControl() { context.ngwMap.addControl(instance, position); return function removeControl() { context.ngwMap.removeControl(instance); }; }, [context.ngwMap, instance], ); // useEffect( // function updateControl() { // if (position !== null && position !== positionRef.current) { // instance.setPosition(position); // positionRef.current = position; // } // }, // [instance, position], // ); return elementRef; }; }
nextgis/ngw_frontend
packages/react-ngw-map/src/control.ts
TypeScript
FunctionDeclaration
export function texprPostReq<I, O>(texprI : ADL.ATypeExpr<I>, texprO : ADL.ATypeExpr<O>): ADL.ATypeExpr<PostReq<I, O>> { return {value : {typeRef : {kind: "reference", value : {moduleName : "test24",name : "PostReq"}}, parameters : [texprI.value, texprO.value]}}; }
bacek/adl
haskell/compiler/tests/test24/ts-output/test24.ts
TypeScript
FunctionDeclaration
export function makeCrudReqs<T>( input: { create: PostReq<T, string>, read: PostReq<string, T>, } ): CrudReqs<T> { return { create: input.create, read: input.read, }; }
bacek/adl
haskell/compiler/tests/test24/ts-output/test24.ts
TypeScript
FunctionDeclaration
export function texprCrudReqs<T>(texprT : ADL.ATypeExpr<T>): ADL.ATypeExpr<CrudReqs<T>> { return {value : {typeRef : {kind: "reference", value : {moduleName : "test24",name : "CrudReqs"}}, parameters : [texprT.value]}}; }
bacek/adl
haskell/compiler/tests/test24/ts-output/test24.ts
TypeScript
FunctionDeclaration
export function makeService( input: { hello?: PostReq<string, string>, farewell?: PostReq<(string|null), (string|null)>, blobs?: CrudReqs<{}|null>, } ): Service { return { hello: input.hello === undefined ? {path : "/hello", reqBodyType : ADL.texprString(), respType : ADL.texprString()} : input.hello, farewell: input.farewell === undefined ? {path : "/farewell", reqBodyType : ADL.texprNullable(ADL.texprString()), respType : ADL.texprNullable(ADL.texprString())} : input.farewell, blobs: input.blobs === undefined ? {create : {path : "/blobs/create", reqBodyType : ADL.texprJson(), respType : ADL.texprString()}, read : {path : "/blobs/read", reqBodyType : ADL.texprString(), respType : ADL.texprJson()}} : input.blobs, }; }
bacek/adl
haskell/compiler/tests/test24/ts-output/test24.ts
TypeScript
FunctionDeclaration
export function texprService(): ADL.ATypeExpr<Service> { return {value : {typeRef : {kind: "reference", value : snService}, parameters : []}}; }
bacek/adl
haskell/compiler/tests/test24/ts-output/test24.ts
TypeScript
InterfaceDeclaration
export interface PostReq<I, O> { path: string; reqBodyType: ADL.ATypeExpr<I>; respType: ADL.ATypeExpr<O>; }
bacek/adl
haskell/compiler/tests/test24/ts-output/test24.ts
TypeScript
InterfaceDeclaration
export interface CrudReqs<T> { create: PostReq<T, string>; read: PostReq<string, T>; }
bacek/adl
haskell/compiler/tests/test24/ts-output/test24.ts
TypeScript