type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
FunctionDeclaration
function getVersionViewUnavailableMessage( deployment: ApplicationDeployment ): IUnavailableServiceMessage | undefined { const serviceUnavailableBecause = unavailableServiceMessageCreator( 'Det er ikke mulig å endre versjonen på denne applikasjonen' ); if (deployment.details.deploymentSpec?.type === 'deve...
Skatteetaten/aurora-konsoll
src/screens/AffiliationViews/DeploymentView/DetailsView/DetailsView.tsx
TypeScript
FunctionDeclaration
function versionStatusMessage( deployment: ApplicationDeployment ): VersionStatus { const { pods, deploymentSpec } = deployment.details; const { deployTag, releaseTo } = deployment.version; const deploymentInProgress = !!deployment.status.reasons.find( (status) => status.name === 'DeploymentInProgressChec...
Skatteetaten/aurora-konsoll
src/screens/AffiliationViews/DeploymentView/DetailsView/DetailsView.tsx
TypeScript
ArrowFunction
(status) => status.name === 'DeploymentInProgressCheck'
Skatteetaten/aurora-konsoll
src/screens/AffiliationViews/DeploymentView/DetailsView/DetailsView.tsx
TypeScript
ArrowFunction
({ filterPathUrl, affiliation, deployment, isRefreshing, deleteAndRefreshApplications, refreshApplicationDeployment, }) => { const match = useRouteMatch<ApplicationDeploymentMatchParams>(); const history = useHistory(); if (!match) { return null; } const unavailableMessage = getVersionViewU...
Skatteetaten/aurora-konsoll
src/screens/AffiliationViews/DeploymentView/DetailsView/DetailsView.tsx
TypeScript
ArrowFunction
() => { history.push(`/a/${affiliation}/deployments${filterPathUrl}`); }
Skatteetaten/aurora-konsoll
src/screens/AffiliationViews/DeploymentView/DetailsView/DetailsView.tsx
TypeScript
InterfaceDeclaration
interface IDetailsViewProps { deployment: ApplicationDeployment; filterPathUrl: string; refreshApplicationDeployment: ( applicationDeploymentId: string, affiliation: string ) => Promise<void>; deleteAndRefreshApplications: ( affiliation: string, namespace: string, name: string ) => Prom...
Skatteetaten/aurora-konsoll
src/screens/AffiliationViews/DeploymentView/DetailsView/DetailsView.tsx
TypeScript
MethodDeclaration
unavailableMessage ? ( <UnavailableServiceMessage message={unavailableMessage} type={unavailableMessage.type} /> ) : ( <VersionViewContainer versionStatus={versionStatus} deploymentSpecVersion={ ...
Skatteetaten/aurora-konsoll
src/screens/AffiliationViews/DeploymentView/DetailsView/DetailsView.tsx
TypeScript
ArrowFunction
({ stream }: any) => this.props.children ? (this.props.children as any)(stream) : stream
SergeyKutlyarov/css-grid-layout-generator
src/_generic/ui/MapElement.tsx
TypeScript
ClassDeclaration
export class MapElement<T> extends React.PureComponent<{ stream: Observable<T> children?: (stream: T) => React.ReactNode }> { render() { return React.createElement(LiftWrapper, { component: ({ stream }: any) => this.props.children ? (this.props.children as any)(stream) : stream, props: { stream: this.pr...
SergeyKutlyarov/css-grid-layout-generator
src/_generic/ui/MapElement.tsx
TypeScript
MethodDeclaration
render() { return React.createElement(LiftWrapper, { component: ({ stream }: any) => this.props.children ? (this.props.children as any)(stream) : stream, props: { stream: this.props.stream }, }) }
SergeyKutlyarov/css-grid-layout-generator
src/_generic/ui/MapElement.tsx
TypeScript
FunctionDeclaration
export function HexTile(props: HexTileProps) { return ( <li> <div className="hexagon" onClick={() => props.tileOnClick(props.letter)}
GabrielF00/spellingbee
src/components/hexTile.tsx
TypeScript
InterfaceDeclaration
export interface HexTileProps { letter: String, tileOnClick: any }
GabrielF00/spellingbee
src/components/hexTile.tsx
TypeScript
ArrowFunction
() => { const renderer = createRenderer(); renderer.render(<Empty />); expect(renderer.getRenderOutput()).toMatchSnapshot(); }
BearerPipelineTest/talk
src/core/client/admin/App/DecisionHistory/Empty.spec.tsx
TypeScript
ArrowFunction
( { alt, aspectRatio, containerProps, imgProps, height, src, width, ...restProps }: ImageProps, ref: Ref<any>, ) => { return ( <ImageContainer {...restProps} {
AdamMichalak/visage
packages/visage/src/components/Image.tsx
TypeScript
InterfaceDeclaration
interface ImageProps { alt?: string; aspectRatio?: number; containerProps?: ExtractVisageComponentProps<typeof ImageContainer>; imgProps?: ExtractVisageComponentProps<typeof Img>; height?: number; src?: string; width?: number; }
AdamMichalak/visage
packages/visage/src/components/Image.tsx
TypeScript
ArrowFunction
(theme: Theme) => ({ projectNav: { minWidth: '15rem', '& a': { color: theme.palette.text.secondary, '&:hover': { background: 'rgba(0, 51, 102, 0.05)' } }, '& a.active': { color: theme.palette.primary.main, background: 'rgba(0, 51, 102, 0.05)', '& svg': { ...
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
() => { const urlParams = useParams(); const location = useLocation(); const biohubApi = useBiohubApi(); const history = useHistory(); const dialogContext = useContext(DialogContext); const classes = useStyles(); const [isLoadingProject, setIsLoadingProject] = useState(false); const [projectWithDeta...
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
() => { const getCodes = async () => { const codesResponse = await biohubApi.codes.getAllCodeSets(); if (!codesResponse) { // TODO error handling/messaging return; } setCodes(codesResponse); }; if (!isLoadingCodes && !codes) { getCodes(); setIsLoadingC...
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
async () => { const codesResponse = await biohubApi.codes.getAllCodeSets(); if (!codesResponse) { // TODO error handling/messaging return; } setCodes(codesResponse); }
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
async () => { const projectWithDetailsResponse = await biohubApi.project.getProjectForView(urlParams['id']); if (!projectWithDetailsResponse) { // TODO error handling/messaging return; } setProjectWithDetails(projectWithDetailsResponse); }
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
() => { if (!isLoadingProject && !projectWithDetails) { getProject(); setIsLoadingProject(true); } }
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
() => dialogContext.setYesNoDialog({ open: false })
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
() => { dialogContext.setErrorDialog({ open: false }); }
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
async (publish: boolean) => { if (!projectWithDetails) { return; } try { const response = await biohubApi.project.publishProject(projectWithDetails.id, publish); if (!response) { showPublishErrorDialog({ open: true }); return; } await getProject(); } cat...
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
() => { dialogContext.setYesNoDialog({ ...defaultYesNoDialogProps, open: true, onYes: () => { deleteProject(); dialogContext.setYesNoDialog({ open: false }); } }); }
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
() => { deleteProject(); dialogContext.setYesNoDialog({ open: false }); }
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
(textDialogProps?: Partial<IErrorDialogProps>) => { dialogContext.setErrorDialog({ ...deleteErrorDialogProps, ...textDialogProps, open: true }); }
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
(textDialogProps?: Partial<IErrorDialogProps>) => { dialogContext.setErrorDialog({ ...publishErrorDialogProps, ...textDialogProps, open: true }); }
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
async () => { if (!projectWithDetails) { return; } try { const response = await biohubApi.project.deleteProject(projectWithDetails.id); if (!response) { showDeleteErrorDialog({ open: true }); return; } history.push(`/admin/projects`); } catch (error) { ...
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
(status_name: string) => { let chipLabel; let chipStatusClass; if (ProjectStatusType.ACTIVE === status_name) { chipLabel = 'ACTIVE'; chipStatusClass = classes.chipActive; } else if (ProjectStatusType.COMPLETED === status_name) { chipLabel = 'COMPLETED'; chipStatusClass = classe...
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
MethodDeclaration
getFormattedDateRangeString( DATE_FORMAT
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
MethodDeclaration
publishProject(!projectWithDetails
bcgov/biohubbc
app/src/features/projects/view/ProjectPage.tsx
TypeScript
ArrowFunction
async ctx => { ctx.end('Hello world!'); }
maximmasterr/uServer
examples/helloWorld.ts
TypeScript
ArrowFunction
value => this._filter(value)
Kalinow/coderadar
coderadar-app/src/app/city-map/autosuggest-wrapper/autosuggest-wrapper.component.ts
TypeScript
ArrowFunction
option => { if (option.hasOwnProperty('name')) { return option.name.toLowerCase().includes(filterValue) || option.author.toLowerCase().includes(filterValue) || new Date(option.timestamp).toUTCString().toLowerCase().includes(filterValue) || filterValue.includes(this.formatVal...
Kalinow/coderadar
coderadar-app/src/app/city-map/autosuggest-wrapper/autosuggest-wrapper.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-autosuggest-wrapper', encapsulation: ViewEncapsulation.None, templateUrl: './autosuggest-wrapper.component.html', styleUrls: ['./autosuggest-wrapper.component.scss'] }) export class AutosuggestWrapperComponent implements OnChanges, OnInit { @ViewChild('inputElement') inputElement...
Kalinow/coderadar
coderadar-app/src/app/city-map/autosuggest-wrapper/autosuggest-wrapper.component.ts
TypeScript
MethodDeclaration
handleValueChanged(chosenModel: any) { this.valueChanged.emit(chosenModel); }
Kalinow/coderadar
coderadar-app/src/app/city-map/autosuggest-wrapper/autosuggest-wrapper.component.ts
TypeScript
MethodDeclaration
formatValue(value: any) { if (value === null || value === undefined) { return ''; } if (value.hasOwnProperty('name')) { return new Date(value.timestamp).toUTCString() + ', ' + value.name.substring(0, 7) + ', ' + value.author; } else { return value; } }
Kalinow/coderadar
coderadar-app/src/app/city-map/autosuggest-wrapper/autosuggest-wrapper.component.ts
TypeScript
MethodDeclaration
ngOnChanges(changes: SimpleChanges) { if (this.model !== null && this.model !== undefined) { this.formControl.setValue(this.model); } this.filteredOptions = this.formControl.valueChanges .pipe( startWith(''), map(value => this._filter(value)) ); }
Kalinow/coderadar
coderadar-app/src/app/city-map/autosuggest-wrapper/autosuggest-wrapper.component.ts
TypeScript
MethodDeclaration
private _filter(value: any): string[] { if (this.source === undefined) { return []; } else if (value === undefined) { return this.source; } let filterValue = ''; if (value.hasOwnProperty('name')) { filterValue = value.name.toLowerCase(); } else { filterValue = value.toL...
Kalinow/coderadar
coderadar-app/src/app/city-map/autosuggest-wrapper/autosuggest-wrapper.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { if (this.model !== null && this.model !== undefined) { this.formControl.setValue(this.model); } this.filteredOptions = this.formControl.valueChanges .pipe( startWith(''), map(value => this._filter(value)) ); }
Kalinow/coderadar
coderadar-app/src/app/city-map/autosuggest-wrapper/autosuggest-wrapper.component.ts
TypeScript
FunctionDeclaration
// Jobs with IDs JOB0 -> JOB4. function testJobs(count: number): QueryJobsResult[] { const base = { status: JobStatus.Running, submission: new Date('2015-04-20T20:00:00'), start: new Date('2015-04-20T20:00:01'), end: new Date('2015-04-20T20:01:00'), extensions: {userId: 'test-user-id'}...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
FunctionDeclaration
function expectJobsRendered(jobs: QueryJobsResult[]) { const de: DebugElement = fixture.debugElement; const rows = de.queryAll(By.css('.mat-row')); expect(rows.length).toEqual(jobs.length); rows.forEach((row, i) => { expect(row.nativeElement.textContent).toContain(jobs[i].name); }); }
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
(_, i) => { return { ...base, id: `JOB${i}`, name: `JOB ${i}` }; }
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { fakeJobService = new FakeJobManagerService(testJobs(5)); capabilities = { displayFields: [ {field: 'name', display: 'Name', primary: true}, {field: 'status', display: 'Status', primary: true}, {field: 'submission', display: 'Submitted', primary: true}, {field: 'ext...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { fixture = TestBed.createComponent(AppComponent); const router: Router = TestBed.get(Router); router.initialNavigation(); router.navigate(['jobs']); tick(); fixture.detectChanges(); tick(); testComponent = fixture.debugElement.query(By.css('jm-job-list')).componentInstance; ...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
(row, i) => { expect(row.nativeElement.textContent).toContain(jobs[i].name); }
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { let error = { status: 400, title: 'Bad Request', message: 'Missing required field `parentId`' }; testComponent.handleError(error); fixture.detectChanges(); let de: DebugElement = fixture.debugElement; expect(de.query(By.css('.mat-simple-snackbar')).nativeElement.textC...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.detectChanges(); tick(); expectJobsRendered(fakeJobService.jobs.slice(0, 3)); }
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { let de: DebugElement = fixture.debugElement; expect(de.queryAll(By.css('.spinner-container')).length).toEqual(0); // Ideally we'd click a nav element here instead, but unfortunately the // navigate and job load would be evaluated within a single tick(), so we'd // never see the loading spi...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { fakeJobService.jobs = testJobs(5); tick(); fixture.detectChanges(); tick(); const de: DebugElement = fixture.debugElement; de.query(By.css('.mat-paginator-increment')).nativeElement.click(); fixture.detectChanges(); tick(); // Page 2. expectJobsRendered(fakeJobService.j...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { fakeJobService.jobs = testJobs(5); tick(); fixture.detectChanges(); const de: DebugElement = fixture.debugElement; de.query(By.css('.mat-paginator-increment')).nativeElement.click(); fixture.detectChanges(); // Back to page 1, which should have the first 3 jobs. de.query(By.css...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { fakeJobService.jobs = testJobs(6); testComponent.jobStream.setStale(); fixture.detectChanges(); tick(100); const de: DebugElement = fixture.debugElement; de.query(By.css('.mat-paginator-increment')).nativeElement.click(); fixture.detectChanges(); // the last three jobs should ...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { const jobs: QueryJobsResult[] = testJobs(5); jobs[1].status = JobStatus.Succeeded; jobs[3].status = JobStatus.Aborted; fakeJobService.jobs = jobs; tick(); fixture.detectChanges(); let de: DebugElement = fixture.debugElement; de.query(By.css('.succeeded-button')).nativeElement.c...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { const jobs = testJobs(5); fakeJobService.jobs = jobs; fixture.detectChanges(); // Filter by active to filter out jobs after they've been aborted. let de: DebugElement = fixture.debugElement; de.query(By.css('.running-button')).nativeElement.click(); fixture.detectChanges(); //...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.detectChanges(); // Jobs 3 and 4 should be the only jobs displayed, as they are the only // remaining active jobs. expectJobsRendered(jobs.slice(3, 5)); }
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { tick(); fixture.detectChanges(); const freshJobs = testJobs(10); freshJobs[0].name = "updated"; freshJobs[1].name = "new"; fakeJobService.jobs = freshJobs; testComponent.jobStream.setStale(); fixture.detectChanges(); tick(1000); fixture.whenStable().then(() => { ...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { fixture.detectChanges(); expectJobsRendered(freshJobs.slice(0, 3)); }
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { const jobs = testJobs(5); jobs[3].status = JobStatus.Failed; fakeJobService.jobs = jobs; tick(); fixture.detectChanges(); const de: DebugElement = fixture.debugElement; de.query(By.css('.mat-paginator-increment')).nativeElement.click(); fixture.detectChanges(); de.query(By...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { capabilities.queryExtensions = ['projectId']; testComponent.reloadJobs(''); fixture.detectChanges(); tick(); const de: DebugElement = fixture.debugElement; expect(de.queryAll(By.css('.fake-projects')).length).toEqual(1); }
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { testComponent.settingsService.setSavedSettingValue('hideArchived', null, testComponent.projectId); fixture.detectChanges(); const de: DebugElement = fixture.debugElement; de.query(By.css('button.settings-icon')).nativeElement.click(); fixture.detectChanges(); expect(de.queryAll(By.css...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ArrowFunction
() => { testComponent.settingsService.setSavedSettingValue('hideArchived', true, testComponent.projectId); fixture.detectChanges(); const de: DebugElement = fixture.debugElement; de.query(By.css('button.settings-icon')).nativeElement.click(); fixture.detectChanges(); expect(de.queryAll(By.css...
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ClassDeclaration
@Component({ selector: 'jm-test-app', template: '<router-outlet></router-outlet>' }) class AppComponent {}
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ClassDeclaration
@Component({ selector: 'jm-test-job-list-component', template: '<jm-job-list [pageSize]="3"></jm-job-list>' }) class TestJobListComponent {}
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
ClassDeclaration
@Component({ selector: 'jm-fake-projects-component', template: '<div class="fake-projects"></div>' }) class FakeProjectsComponent {}
DataBiosphere/job-manager
ui/src/app/job-list/job-list.component.spec.ts
TypeScript
FunctionDeclaration
/** * Numeric rounding * * Example: round to 3 decimal places * ``` * makerjs.round(3.14159, .001); //returns 3.142 * ``` * * @param n The number to round off. * @param accuracy Optional exemplar of number of decimal places. */ function round(n: number, accuracy?: numbe...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Create a string representation of a route array. * * @param route Array of strings which are segments of a route. * @returns String of the flattened array. */ function createRouteKey(route: string[]): string;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Clone an object. * * @param objectToClone The object to clone. * @returns A new clone of the original object. */ function cloneObject<T>(objectToClone: T): T;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Copy the properties from one object to another object. * * Example: * ``` * makerjs.extendObject({ abc: 123 }, { xyz: 789 }); //returns { abc: 123, xyz: 789 } * ``` * * @param target The object to extend. It will receive the new properties. * @param other An object con...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Test to see if a variable is a function. * * @param value The object to test. * @returns True if the object is a function type. */ function isFunction(value: any): boolean;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Test to see if a variable is a number. * * @param value The object to test. * @returns True if the object is a number type. */ function isNumber(value: any): boolean;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Test to see if a variable is an object. * * @param value The object to test. * @returns True if the object is an object type. */ function isObject(value: any): boolean;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Test to see if an object implements the required properties of a point. * * @param item The item to test. */ function isPoint(item: any): boolean;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Test to see if an object implements the required properties of a path. * * @param item The item to test. */ function isPath(item: any): boolean;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Test to see if an object implements the required properties of a line. * * @param item The item to test. */ function isPathLine(item: any): boolean;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Test to see if an object implements the required properties of a circle. * * @param item The item to test. */ function isPathCircle(item: any): boolean;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Test to see if an object implements the required properties of an arc. * * @param item The item to test. */ function isPathArc(item: any): boolean;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Test to see if an object implements the required properties of an arc in a bezier curve. * * @param item The item to test. */ function isPathArcInBezierCurve(item: any): boolean;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Test to see if an object implements the required properties of a model. */ function isModel(item: any): boolean;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Ensures an angle is not greater than 360 * * @param angleInDegrees Angle in degrees. * @retiurns Same polar angle but not greater than 360 degrees. */ function noRevolutions(angleInDegrees: number): number;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Convert an angle from degrees to radians. * * @param angleInDegrees Angle in degrees. * @returns Angle in radians. */ function toRadians(angleInDegrees: number): number;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Convert an angle from radians to degrees. * * @param angleInRadians Angle in radians. * @returns Angle in degrees. */ function toDegrees(angleInRadians: number): number;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Get an arc's end angle, ensured to be greater than its start angle. * * @param arc An arc path object. * @returns End angle of arc. */ function ofArcEnd(arc: IPathArc): number;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Get the angle in the middle of an arc's start and end angles. * * @param arc An arc path object. * @param ratio Optional number between 0 and 1 specifying percentage between start and end angles. Default is .5 * @returns Middle angle of arc. */ function ofArcMiddle(arc: IPathArc, rat...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Total angle of an arc between its start and end angles. * * @param arc The arc to measure. * @returns Angle of arc. */ function ofArcSpan(arc: IPathArc): number;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Angle of a line path. * * @param line The line path to find the angle of. * @returns Angle of the line path, in degrees. */ function ofLineInDegrees(line: IPathLine): number;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Angle of a line through a point, in degrees. * * @param pointToFindAngle The point to find the angle. * @param origin Point of origin of the angle. * @returns Angle of the line throught the point, in degrees. */ function ofPointInDegrees(origin: IPoint, pointToFindAngle: IPoint): num...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Angle of a line through a point, in radians. * * @param pointToFindAngle The point to find the angle. * @param origin Point of origin of the angle. * @returns Angle of the line throught the point, in radians. */ function ofPointInRadians(origin: IPoint, pointToFindAngle: IPoint): num...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Mirror an angle on either or both x and y axes. * * @param angleInDegrees The angle to mirror. * @param mirrorX Boolean to mirror on the x axis. * @param mirrorY Boolean to mirror on the y axis. * @returns Mirrored angle. */ function mirror(angleInDegrees: number, mirrorX: boole...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Add two points together and return the result as a new point object. * * @param a First point. * @param b Second point. * @param subtract Optional boolean to subtract instead of add. * @returns A new point object. */ function add(a: IPoint, b: IPoint, subtract?: boolean): IPoint...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Get the average of two points. * * @param a First point. * @param b Second point. * @returns New point object which is the average of a and b. */ function average(a: IPoint, b: IPoint): IPoint;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Clone a point into a new point. * * @param pointToClone The point to clone. * @returns A new point with same values as the original. */ function clone(pointToClone: IPoint): IPoint;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * From an array of points, find the closest point to a given reference point. * * @param referencePoint The reference point. * @param pointOptions Array of points to choose from. * @returns The first closest point from the pointOptions. */ function closest(referencePoint: IPoint, point...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Get a point from its polar coordinates. * * @param angleInRadians The angle of the polar coordinate, in radians. * @param radius The radius of the polar coordinate. * @returns A new point object. */ function fromPolar(angleInRadians: number, radius: number): IPoint;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Get a point on a circle or arc path, at a given angle. * @param angleInDegrees The angle at which you want to find the point, in degrees. * @param circle A circle or arc. * @returns A new point object. */ function fromAngleOnCircle(angleInDegrees: number, circle: IPathCircle): IPoint;
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Get the two end points of an arc path. * * @param arc The arc path object. * @returns Array with 2 elements: [0] is the point object corresponding to the start angle, [1] is the point object corresponding to the end angle. */ function fromArc(arc: IPathArc): IPoint[];
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Get the two end points of a path. * * @param pathContext The path object. * @returns Array with 2 elements: [0] is the point object corresponding to the origin, [1] is the point object corresponding to the end. */ function fromPathEnds(pathContext: IPath, pathOffset?: IPoint): IPoint[];
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Calculates the intersection of slopes of two lines. * * @param lineA First line to use for slope. * @param lineB Second line to use for slope. * @param options Optional IPathIntersectionOptions. * @returns point of intersection of the two slopes, or null if the slopes did not interse...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Get the middle point of a path. * * @param pathContext The path object. * @param ratio Optional ratio (between 0 and 1) of point along the path. Default is .5 for middle. * @returns Point on the path, in the middle of the path. */ function middle(pathContext: IPath, ratio?: number): ...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript
FunctionDeclaration
/** * Create a clone of a point, mirrored on either or both x and y axes. * * @param pointToMirror The point to mirror. * @param mirrorX Boolean to mirror on the x axis. * @param mirrorY Boolean to mirror on the y axis. * @returns Mirrored point. */ function mirror(pointToMirror: IPoi...
HydTechie/DefinitelyTyped
maker.js/makerjs.d.ts
TypeScript