lang
stringclasses
10 values
seed
stringlengths
5
2.12k
typescript
import LoggerContainer, { useLoggerApi } from './LoggerContainer'; import { LoggerInterface } from './types'; import { logger } from './logger'; export default logger; export { LoggerContainer, useLoggerApi, LoggerInterface };
typescript
export function stop({ connection, request }: { connection: Connection; request: CircuitRequest; }): Promise<MuxedStream | void>; export type Connection = import("libp2p-interfaces/src/connection/connection"); export type MuxedStream = import("libp2p-interfaces/src/stream-muxer/types").MuxedStream; export type CircuitRequest = { type: import("../../types").CircuitType; dstPeer: import("../../types").CircuitPeer;
typescript
const handleCloseDrawer = () => { setDrawerState(false); }; return ( <Box sx={{ display: { xs: "flex", sm: "none" }, flexDirection: "row-reverse", flexGrow: 1, }}> <IconButton size="large" aria-label="navigation" aria-haspopup="true" onClick={handleOpenDrawer} color="inherit"> <MenuIcon /> </IconButton> <Drawer variant="temporary" anchor="top" open={drawerState} onClose={handleCloseDrawer}> <List sx={{ display: { xs: "block", sm: "none" } }}> {pages.map((page) => ( <Link key={page} to={page} smooth={true} offset={-48}> <ListItem button onClick={handleCloseDrawer}>
typescript
return sizes || defaultSizes; }; const setDefaultSizePane = (sizes: number[]) => { const {defaultSizePaneKey} = props; localStorage.setItem(defaultSizePaneKey, sizes.join(',')); }; const onDragHandler = (sizes: number[]) => { const {onSplitDrugAdditional} = props; if (onSplitDrugAdditional) { onSplitDrugAdditional(); } setDefaultSizePane(sizes); };
typescript
}) .compileComponents(); }); beforeEach(() => { fixture = TestBed.createComponent(CapturaDeDatosComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy();
typescript
import { Field, InputType } from 'type-graphql'; import { EntityId, EntityIdScalar } from './EntityId'; @InputType() export class ReferenceSearchInput { @Field(() => EntityIdScalar, { nullable: true })
typescript
to: string; options?: QueryParams; constructor(rootDefinition: BadgeDefinition, variation: string, id: string) { const coreSpec = { details: rootDefinition.details, display: rootDefinition.display, path: rootDefinition.path, options: rootDefinition.options, to: rootDefinition.to,
typescript
delta = rescap[arcForward]; vertex = head[arcBackward]; while (vertex != source) { arcBackward = path[vertex]; vertex = head[arcBackward]; arcForward = arcBackward + 1; if (arcBackward % 2 == 0) { arcForward = arcBackward - 1; } if (delta > rescap[arcBackward]) { delta = rescap[arcForward]; } console.log("\n");
typescript
import { CompileOptions, CompileResults } from '@stencil/core/internal'; export declare function transpile(input: string, opts?: CompileOptions): CompileResults;
typescript
} type LineProps = { readonly prevNodeId: number; readonly nextNodeId: number; readonly lengthM: number; readonly phase: number; readonly code: string; readonly rOhmPerKm: number; readonly xOhmPerKm: number; };
typescript
// if .vscode/settings.json exists -> use settings to override workspace settings const vscodeSettingsFolder: string = getVscodeFolderPath(workspaceFolderPath); const filePath = join(vscodeSettingsFolder, "settings.json"); if (fs.existsSync(filePath)) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const settingsFileJson = loadJson(filePath) as Record<string, any>; settingsMap.forEach((propertyName, settingName) => { const configuredValue = settingsFileJson[settingName]; if (configuredValue !== undefined) { // eslint-disable-next-line @typescript-eslint/no-explicit-any
typescript
} return false } /** * 销毁对户框,将其从list里面移除 * @memberOf Dialog */ $destroy(){ let data: { list: Dialog[]} = this._data as any data.list.splice(data.list.findIndex(dialog=> dialog.id === this.id), 1) this._data = null
typescript
init = (el: Element) => render(this, el) @On({selector: 'button'}) click() { this.func('Earth') } @Template() markupAll() { return `
typescript
import { View } from "tns-core-modules/ui/core/view"; export declare class Common extends View { }
typescript
it.todo('should create a domain object in the store'); it.todo('should update a domain object in the store'); it.todo('should delete a domain object from the store'); it.todo('should retrieve a domain object by id'); it.todo('should search a domain object table by text'); it.todo('should notify of success for a store action'); it.todo('should notify of failure for a store action'); it.todo('should upsert a domain object in the circular memory log'); it.todo('should retrieve the circular memory log'); it.todo('should trigger an telemetry action'); it.todo('should trigger an export action'); it.todo('should trigger an import action'); });
typescript
import { Offset } from '../models/offset.model'; import { DrawableCanvasFacade } from './../facades/drawable-canvas.facade'; import { DrawingState } from './../models/drawing-state.model'; import { Point } from './../models/point.model'; import { Rect } from './../models/rect.model';
typescript
import PaddedContainer from '../components/Container/Container'; import MenuTabs from '../components/Tabs/MenuTabs'; export default function MenuScreen() { return ( <PaddedContainer> <Grid container spacing={3}> <Grid item xs={12}> <MenuTabs /> </Grid> </Grid> </PaddedContainer> ); }
typescript
InfoCompressionComponent ], imports: [ BrowserModule, AppRoutingModule,
typescript
const FullScreenLoader = () => ( <View style={[StyleSheet.absoluteFill, {flex: 1, justifyContent: 'center', alignItems: 'center'}]}> <ActivityIndicator size = {90} color='#40ADEC'/> </View> ); export default FullScreenLoader
typescript
} } export function createChromeLocalStorage(): Storage {
typescript
import { init as rolandbergerInit , ChartInitOpts} from './core/rolandBerger'; export default { init(dom: HTMLElement, opts?: ChartInitOpts) { return rolandbergerInit(dom,opts); }, }; //# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map
typescript
this.Request.Priority(), this.Request.DueDate(), this.Request.AdditionalInstructions(), ko.utils.arrayMap(Requests.Details.rovm.RequestDataMarts() || [], (dm: Requests.Details.RequestDataMartViewModel) => <Dns.Interfaces.IRequestDataMartDTO>{ DataMart: dm.DataMart(), DataMartID: dm.DataMartID(), RequestID: dm.RequestID(), ID: dm.ID(), Status: dm.Status(), Priority: dm.Priority(), DueDate: dm.DueDate(), ErrorMessage: null, ErrorDetail: null, RejectReason: null, Properties: null, ResponseGroup: null, ResponseMessage: null }), Requests.Details.rovm.RequestType, this.Request.ProjectID(), this.Request.ID()) .done((viewModel) => { self.QueryEditor = viewModel;
typescript
import { HttpClient } from '@angular/common/http'; import { catchError } from 'rxjs/operators'; import { Observable } from 'rxjs'; @Injectable()
typescript
<gh_stars>0 import { IsString } from 'class-validator'; import { Question } from '../entities/question.entity'; export class CreateQuestionDto extends Question { @IsString() title: string; }
typescript
// TypeScript and Promises Promise.resolve(123) .then(res => { // `res` is inferred to be of type `number` return true; })
typescript
nodeOffset: { x: 20, y: 0 } }) } onAttach={(c) => { assert(c.processedChildren.get(0).processedChildren.length.value === 3); assert.deepEqual(c.processedChildren.get(0).processedChildren.get(0).getAbsolutePosition(), { x: 10, y: 10 }); assert.deepEqual(c.processedChildren.get(0).processedChildren.get(1).getAbsolutePosition(), { x: 30, y: 10 }); assert.deepEqual(c.processedChildren.get(0).processedChildren.get(2).getAbsolutePosition(), { x: 50, y: 10 });
typescript
.map((_n, i) => i.toString().padStart(2, '0')), ); const makeid = (i: number): string => ids[i]; /* eslint-disable class-methods-use-this */ export default class PullusAgeProcessor implements IProcessor<PullusAge> { public preProcess(name: string, object: any): any { console.log(makeid(parseInt(name.replace(/\D/g, ''), 10))); return { ...object, id: makeid(parseInt(name.replace(/\D/g, ''), 10)), }; }
typescript
end = {x: _zentrum.x, y: _zentrum.y + _radius}; start = {x: _zentrum.x - _radius, y: _zentrum.y}; break; case 2: end = {x: _zentrum.x - _radius, y: _zentrum.y}; start = {x: _zentrum.x, y: _zentrum.y - _radius}; break; case 3: end = {x: _zentrum.x, y: _zentrum.y - _radius}; start = {x: _zentrum.x + _radius, y: _zentrum.y}; break; }
typescript
interface IParser { run:()=>void; } export default IParser;
typescript
import { AggregatorState, SwitchboardAccountType, } from "@switchboard-xyz/switchboard-api"; import { RedisConfig, RedisStore, createRedisStore } from "./redis";
typescript
import path from "path"; import { Project } from "ts-morph"; const project = new Project(); project.addSourceFilesAtPaths(path.join(__dirname, "templates", "*.ts")); export const contractClassStructure = project .getSourceFileOrThrow("MyContract.ts") .getStructure();
typescript
import withAuthContext from "./components/withAuthContext"; /** * UI For Login Screen */ export function LoginView(props: LoginViewProps) { return null; };
typescript
</Box> ); }; export const DummySubscChannels = () => { const classes = useStyles(); return ( <Container maxWidth={"lg"} className={classes.root}> {Array.from({ length: 4 }) .fill(null) .map((_a, i) => (
typescript
import { Model, Parent, Property, Unique } from "../../utils/decorators" import { ApiModel } from "../api.entity" import { User } from "./user.entity" @Model({createTable: false}) @Unique('userId', 'comment') export class Comment extends ApiModel { @Parent({ type: () => User, output: true }) userId: string @Property({ nullable: false, output: true, validate: 'asString' }) comment: string }
typescript
} else { ctrl.assert({ success: result.success, reason: "Snapshot doesn't match", negatedReason: '-', actual: result.actual, expected: result.expected, }) }
typescript
import Arc from './Arc'; export default class Circle extends Arc { constructor(x?: number, y?: number, radius?: number); }
typescript
const { orgCode = '' } = useParams<{ orgCode: string }>(); const dispatch = useDispatch(); const users = useSelector<UserState, User[]>((state) => state.users); const isLoading = useSelector<UserState, boolean>((state) => state.isLoading); useEffect(() => { dispatch(userSlice.actions.getMembersStarted({ orgCode })); }, [orgCode, dispatch]);
typescript
@Patch('/') update(@Request() req, @Body() updateHouseDto: UpdateHouseDto) { return this.houseService.update(req.user.houseId, updateHouseDto); } @Delete(':id') remove(@Param('id') id: string) { return this.houseService.remove(+id);
typescript
let appRoutes = { 'login': { to: "views/login/login-page/" } }; export { appRoutes };
typescript
import '@nuxt/vue-app' declare module 'vue/types/vue' { interface Vue { apollo: any } } // taken from https://github.com/Akryum/vue-apollo/blob/master/types/vue.d.ts // since https://github.com/Akryum/vue-apollo/pull/627 is not yet merged + released declare module 'vue/types/options' { interface ComponentOptions<V extends Vue> { apollo?: any } }
typescript
// Type definitions for p-whilst 1.0 // Project: https://github.com/sindresorhus/p-whilst#readme // Definitions by: BendingBender <https://github.com/BendingBender> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = pWhilst; declare function pWhilst(condition: () => boolean, action: () => any): Promise<void>;
typescript
class DriverPropertyInfo { public name: java.lang.String public description: java.lang.String public required: boolean public value: java.lang.String public choices: java.lang.String[] public constructor(arg0: java.lang.String | string, arg1: java.lang.String | string) } } }
typescript
export interface SkyAuthTokenContextArgs { permissionScope?: string; }
typescript
<gh_stars>1000+ /** * @packageDocumentation * @internal */ export * from "./action" export * from "./base"
typescript
describe('RotateDirective', () => { it('should create an instance', () => { const directive = new RotateDirective(); expect(directive).toBeTruthy(); }); });
typescript
export var BargeOnAgentResponse_Supervisor = { };
typescript
/** * Storage interface for LocalStorage * https://developer.mozilla.org/en-US/docs/Web/API/Storage * @module monitor */ export interface LocalStorage { length: number; setItem: (key: string, value: any) => void; getItem: (key: string) => any | null; removeItem: (key: string) => void; key: (n: number) => any | null; clear: () => void; }
typescript
} from '@nestjs/common'; import { CreateCustomerDto, UpdateCustomerDto } from '../dtos/customer.dto'; import { Customer } from '../entities/customer.entity'; import { CustomersService } from '../services/customers.service'; import { ApiTags } from '@nestjs/swagger';
typescript
export class DSTU2_MessageHeader_Source extends DSTU2_BackboneElement { static def : string = 'MessageHeader_Source'; name : string ; software : string ; version : string ; contact : DSTU2_ContactPoint ; endpoint : string ;
typescript
} export const Providers: React.FC<ProvidersProps> = ({ children, client = new QueryClient() }) => { return ( <QueryClientProvider client={client}> {children} </QueryClientProvider> )
typescript
import * as React from 'react'; import * as PropTypes from 'prop-types'; import * as ReactDOM from 'react-dom'; type WPProps = { className?: string; measureBeforeMount: boolean; style?: Object;
typescript
children?: any } export interface SelectOption { label: string
typescript
}, '&:hover': { opacity: 1, backgroundColor: '#424040', },
typescript
}); } @Get('/codigo/:codigo') getByName( @Res() response, @Param('codigo') codigo, ) { this.configuracionService.getByCode(codigo).then(( configuracion: Configuracion ) => { if ( configuracion ) { response.status(HttpStatus.OK)
typescript
export declare type OptionType = 'SUB_COMMAND' | 'SUB_COMMAND_GROUP' | 'STRING' | 'INTEGER' | 'BOOLEAN' | 'USER' | 'CHANNEL' | 'ROLE' | 'MENTIONABLE' | 'NUMBER'; export declare const optionTypeValues: Record<OptionType, number>; export interface OptionDef { type: OptionType; name: string; description: string; required?: boolean; choices?: OptionChoice[]; options?: OptionDef[]; }
typescript
<gh_stars>1-10 import { addProp } from "@pnp/odata"; import { _User } from "../users/types"; import { IOneNote, OneNote } from "./types"; declare module "../users/types" { interface _User { readonly onenote: IOneNote; }
typescript
export { default as formatDate } from './formatDate'; export { default as ipfs } from './ipfs'; export { default as searchForSale } from './searchForSale'; export { default as titleCase } from './titleCase';
typescript
private user: User; constructor(private _authenticationService: AuthenticationService){} /**
typescript
export const REDIS_DOMAIN_TYPES = { RedisPublisher: Symbol('RedisPublisher'), }; // eslint-disable-next-line @typescript-eslint/typedef export const REDIS_DOMAIN_PUBLIC_TYPES = { RedisPublisher: REDIS_DOMAIN_TYPES.RedisPublisher,
typescript
export const BUGFINDER_COMMITPATH_ANNOTATOR_COMMITMSG_TYPES = { testFileMatcher: Symbol("TestFileMatcher") }
typescript
import { Input } from "./Input.styles-api"; export const PinInput = Input;
typescript
path = Controller.name; } const parent = Object.getPrototypeOf(Controller); if (parent[Tags.tagController]) { path = parent[Tags.tagController] + path; } Controller[Tags.tagController] = path; };
typescript
export class GetProductFilterDto { @IsOptional() @IsIn([IsPublic.All, IsPublic.Approved, IsPublic.NotApproved]) isPublished: IsPublic;
typescript
import * as github from '@actions/github'; function noop() { console.log(`Do nothing on ${github.context.repo.owner}/${github.context.repo.repo}`) } export default noop;
typescript
public top3Level: number constructor(data: string) { const rankData = this.parseString(data) this.top1Name = rankData[1] this.top1Level = +rankData[2] this.top2Name = rankData[3] this.top2Level = +rankData[4] this.top3Name = rankData[5] this.top3Level = +rankData[6]
typescript
import { TableColumnSelector } from "./table-column-selector"; import { TableColumnStyleBase } from "./table-column-style-base"; /** * Signature/interface for a `ConditionalTableColumnStyle` object * @see https://developer.apple.com/documentation/apple_news/conditionaltablecolumnstyle */ export interface ConditionalTableColumnStyle extends TableColumnStyleBase { selectors: TableColumnSelector[]; }
typescript
import { HorizontalDivider } from "../../core-ui/building-blocks/dividers/horizontal-divider"; import { Space } from "../../core-ui/building-blocks/space/space"; import { Stack } from "../../core-ui/building-blocks/stack/stack"; import { Profile } from "../../data-fetchers/profile/types"; import { About } from "../about/about"; import { Bio } from "../bio/bio";
typescript
version https://git-lfs.github.com/spec/v1 oid sha256:73e4aabc86eb2032b7015b342b4ccbf6e7280a4790dce9bb8a557eb51f1562c1 size 1460948
typescript
private toView(data: any): SiteView { return new SiteView(data._id.toString(), data.type, data.title, data.content, data.url); } private async getCollection(): Promise<Collection> { const db = await this.db;
typescript
onSave.mockReset(); onCancel.mockReset(); }); it('renders as expected', async () => { const { component } = await setup({}); expect(component.asFragment()).toMatchSnapshot(); }); it('renders with data as expected', async () => { const { component } = await setup({ initialValues: FormLeaseDepositReturn.createEmpty(mockDeposit), }); expect(component.asFragment()).toMatchSnapshot();
typescript
import { generate as generator } from './generator'; import { Generator } from '@vize/types'; export default <Generator>{ info: { name: 'Web', desc: '生成 Web 普通页面', author: '<EMAIL>', }, generator, };
typescript
const follow = createFollower(opts) const maxDepth = typeof opts.depth == 'number' ? Math.max(0, opts.depth)
typescript
return SubEventType.NATIONAL; } switch (type?.toUpperCase()) { case 'G': return SubEventType.MX; case 'D': return SubEventType.F; case 'H': return SubEventType.M; default: logger.warn('no type?', name);
typescript
} return true; } export = makeBuildDir;
typescript
<gh_stars>1-10 export * from './get-selected-project-prod-repo-struct-id';
typescript
return } if (href) { window.open(sanitizeURL(href)) }
typescript
createClient, deleteClient, updateClient } from "../repositories/client.repository"; /** * The controller class is used to control the SwaggerUI */
typescript
new Date(a.date.join(`/`)) < new Date(b.date.join(`/`)) ? -1 : 1 ) } } } return {} } export default function archive({ about, data }: { about: string data: Props[]
typescript
}) .map(result => this.fromKeyValuePair(result, key)); } private fromKeyValuePair(translations: KeyValuePairString[], key: string) { const newTranslation = { 'ENUMS': {}, }; newTranslation.ENUMS[key] = {}; translations.forEach(keyValue => { newTranslation.ENUMS[key][keyValue.key] = keyValue.value; }); return newTranslation; }
typescript
component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); });
typescript
for (const [i, part] of string.split(color).entries()) { if (i % 2 === 0) { for (const char of part.split("")) { if (index >= start && index < end) { result += char; } index++; } } else if ( start === 0 && end === 0 ? false : start === 0 ? index >= 0 && index <= end
typescript
export const getFileContent = (filepath: string) => readFileAsync(filepath, 'utf8'); export const runInSandbox = async function(filePath: string, context: vm.Context) { const fileContent:string = await getFileContent(filePath); // vm.createContext(context); vm.runInNewContext(fileContent, context); return context }
typescript
const toAcceptPassCode = useCallback( (passCode: string) => { if (standaloneStore.validatePassCode(passCode)) { setIsError(false); navigate(getLoginUrn());
typescript
import { InjectionToken } from '@angular/core'; import { GlobalConfig } from './toast.config'; export const TOAST_CONFIG = new InjectionToken<GlobalConfig>('ToastConfig');
typescript
} findOneByIdForPayload(id: string): Promise<UsersEntity> { // for refresh return this.usersRepository.findOne({ where: { id }, select: ["id", "pseudo", "email"] }); } updateActivity(id: string) { const dateNow = new Date(); return this.usersRepository .createQueryBuilder()
typescript
declarations: [ AppComponent, OverviewComponent, CheckListComponent, InputComponent, PaymentComponent ], imports: [ BrowserModule, AppRoutingModule, BrowserAnimationsModule,
typescript
@Patch(':id') update(@Param('id') id: string, @Body() data: IUpdateDeviceTypeDto): Promise<IDeviceType> { return this.deviceTypesService.update(Number(id), data); } @Delete(':id') remove(@Param('id') id: string): Promise<IDeviceType> {
typescript
import { MigrationInterface, QueryRunner } from 'typeorm'; export class CreateDataBase1627959485570 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise<void> { queryRunner.createDatabase('woopDb', true); } public async down(queryRunner: QueryRunner): Promise<void> { queryRunner.dropDatabase('woopDb', true); }
typescript
const { data } = await axios.post<ApiResponse>(`${expressUrl}/user/set-ssn`, { ssn_token }); return data; } async function loadUser() { const { data } = await axios.get<UserResponse>(`${expressUrl}/user/me`); return data; } export const expressTransport = { signup, login, saveSsn,
typescript
import { VideoModule } from "./view/video_v"; import { BackgroundModule } from "./view/background_v"; /** * 生成组件类型
typescript
import { sleep } from './async'; describe('async utils', () => { it('should sleep function return promise', () => { expect(sleep() instanceof Promise).toBeTruthy(); }); });
typescript
<gh_stars>10-100 export enum EFortWeaponTriggerType { OnPress, Automatic, OnRelease, OnPressAndRelease }
typescript
public constructor() {} } export class AddMessage implements Action { public readonly type = FeedActionTypes.AddMessage; public constructor(public payload: string) {} } export class AddMessageSuccess implements Action {
typescript
languageMap: { ts: 'typescript' } }; // https://mermaid-js.github.io/mermaid/#/mermaidAPI?id=mermaidapi-configuration-defaults export const DEFAULT_MERMAID_OPTIONS = { flowchart: { useMaxWidth: true, htmlLabels: true }, startOnLoad: false,
typescript
get setTheme() { return this.theme === 1 ? true : false; } isOpenMenu() {
typescript
<SyntaxHighlighter showLineNumbers={showLineNumbers} language={language || 'xml'} customStyle={{fontSize: '75%', backgroundColor: '#F1F3F5'}} > {children} </SyntaxHighlighter> )} </Box> )
typescript
script: { script: Buffer; filename: string }; } export interface WorkerBridge<T extends Worker> { setup(): Promise<void>; create(): Promise<T>; destroy(worker: T): Promise<void>; send<U extends keyof WorkerMessages>( worker: T, type: U, message: WorkerMessages[U] ): Promise<void>; } export interface WorkerBridgeFactory<T extends Worker> {
typescript
const Bio: React.FC<Props> = ({ data: { ar, en } }) => ( <Layout> <SEO title="About Me" /> <div css={css` margin: 10px 0px;
typescript
removeAnimationFromStack(animId: any): void; getElementAnimationDelay(element: any): number; move(): Promise<boolean>; enter(element: any): Promise<{}>; leave(element: any): Promise<{}>; removeClass(element: any, className: any): Promise<{}>; addClass(element: any, className: any): Promise<{}>; } } declare module 'aurelia-animator-css/index' {
typescript
const payment = await paymentBuild().save(); const oldStripeId = payment.stripeId; const newStripeId = mongoose.Types.ObjectId().toHexString(); const updatedPayment = payment.set({stripeId: newStripeId}) await updatedPayment.save(); expect(updatedPayment.stripeId).not.toEqual(oldStripeId); expect(updatedPayment.stripeId).toEqual(newStripeId); });