type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ClassDeclaration
@Entity() export class Project { @PrimaryGeneratedColumn('uuid') id: string; @Column({ type: 'text' }) projectName: string; @ManyToOne(type => Client) client: Client; @ManyToOne(type => ProjectSector) projectSector: ProjectSector; @Column({ type: 'text', nullable: true }) commodityCode: string;...
acoard-aot/Project-and-time-tracker
api/src/app/models/entities/project.entity.ts
TypeScript
EnumDeclaration
export enum ProjectCategory { CSA = 1, ITQ = 2, CostRecoverable = 3, NonRecoverable = 4 }
acoard-aot/Project-and-time-tracker
api/src/app/models/entities/project.entity.ts
TypeScript
FunctionDeclaration
async function run() { let jobs: LocalApi.JobEntry[]; try { if (!config.jobs) { throw new Error(`Please provide 'jobs' argument. See [-h] for help.`); } jobs = JSON.parse(fs.readFileSync(config.jobs, 'utf-8')); } catch (e) { console.error('' + e); return...
azangru/molstar
src/servers/volume/query.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-button/platform-button.module').then( (m) => m.PlatformButtonDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformButtonDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-action-bar/platform-action-bar.module').then( (m) => m.PlatformActionBarDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformActionBarDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-forms/checkbox/platform-checkbox-docs.module').then( (m) => m.CheckboxDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.CheckboxDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import( './component-docs/platform-forms/platform-checkbox-group/platform-checkbox-group-docs.module' ).then((m) => m.PlatformCheckboxGroupDocsModule)
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformCheckboxGroupDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-link/platform-link.module').then((m) => m.PlatformLinkDocsModule)
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformLinkDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-menu/platform-menu.module').then((m) => m.PlatformMenuDocsModule)
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformMenuDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-menu-button/platform-menu-button.module').then( (m) => m.PlatformMenuButtonDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformMenuButtonDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-search-field/platform-search-field.module').then( (m) => m.PlatformSearchFieldDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformSearchFieldDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-select/platform-select.module').then( (m) => m.PlatformSelectDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformSelectDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-forms/radio-group/platform-radio-group.module').then( (m) => m.PlatformRadioGroupDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformRadioGroupDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-split-menu-button/platform-split-menu-button.module').then( (m) => m.PlatformSplitMenuButtonDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformSplitMenuButtonDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-info-label/platform-info-label-docs-module').then( (m) => m.PlatformInfoLabelDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformInfoLabelDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-forms/platform-textarea/platform-textarea-docs.module').then( (m) => m.PlatformTextareaDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformTextareaDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-panel/platform-panel.module').then( (m) => m.PlatformPanelDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformPanelDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-forms/switch/platform-switch-docs.module').then( (m) => m.PlatformSwitchDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformSwitchDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-forms/platform-input/platform-input-docs.module').then( (m) => m.PlatformInputDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformInputDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-forms/step-input/platform-step-input.module').then( (m) => m.PlatformStepInputDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformStepInputDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-object-status/platform-object-status-docs.module').then( (m) => m.PlatformObjectStatusDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformObjectStatusDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-forms/input-group/platform-input-group-docs.module').then( (m) => m.PlatformInputGroupDocsModule )
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformInputGroupDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-combobox/platform-combobox-docs.module') .then(m => m.PlatformComboboxDocsModule)
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
m => m.PlatformComboboxDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-list/platform-list-docs.module').then((m) => m.PlatformListDocsModule)
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformListDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
() => import('./component-docs/platform-standard-list-item/platform-standard-list-item-docs.module').then((m) => m.PlatformStandardListItemDocsModule)
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
ArrowFunction
(m) => m.PlatformStandardListItemDocsModule
IlyaSurmay/fundamental-ngx
apps/docs/src/app/platform/platform-documentation.routes.ts
TypeScript
TypeAliasDeclaration
export type CreateArgs = { songName: string; artistName: string; transcriberId: string; tagIds: string[]; thumbnail: FileUpload; video: FileUpload; };
jaredjj3/string-sync
api/src/services/Notation/types.ts
TypeScript
TypeAliasDeclaration
export type UpdateArgs = { songName?: string; artistName?: string; deadTimeMs?: number; durationMs?: number; private?: boolean; videoUrl?: string; thumbnail?: FileUpload; musicXml?: FileUpload; };
jaredjj3/string-sync
api/src/services/Notation/types.ts
TypeScript
ClassDeclaration
/** * A utility for estimating the remaining time for an action. * @public */ export class TimeEstimator extends GCObject { private M$cacheSize: number private M$snapshotStack: Array<[progress: number, timeStamp: number]> = [] private M$alreadyCompleted = false /** * @param cacheSize - Number of snapsho...
glyph-cat/swiss-army-knife
src/datetime/time-estimation/index.ts
TypeScript
MethodDeclaration
/** * Insert a snapshot of the current progress. * @param progress - The current progress in percentage. Value must be between * `0` and `100`. */ mark(progress: number): void { if (progress === MAX_PROGRESS) { this.M$alreadyCompleted = true return // Early exit } this.M$snapshotStac...
glyph-cat/swiss-army-knife
src/datetime/time-estimation/index.ts
TypeScript
MethodDeclaration
/** * Get the time estimation in milliseconds. * @returns * - The time estimation in milliseconds under ordinary circumstances, * - or `Infinity` if: * - there are not enough snapshots yet, * - all snapshots in memory have the same progress value, since this * theoritically means it will ta...
glyph-cat/swiss-army-knife
src/datetime/time-estimation/index.ts
TypeScript
MethodDeclaration
/** * Clears all snapshots in the cache. */ reset(): void { this.M$alreadyCompleted = false this.M$snapshotStack = [] }
glyph-cat/swiss-army-knife
src/datetime/time-estimation/index.ts
TypeScript
ArrowFunction
(obj) => ({ value: obj.x, duration: obj.source.actionDuration || 0, lane: obj.y.toString(), data: { name: (obj.source && obj.source.name) || '', type: (obj.source && obj.source.type) || '', }, })
PedroMosquera/barista
apps/dev/src/event-chart/easy-travel-test-data.ts
TypeScript
ArrowFunction
(l) => l.name === name
PedroMosquera/barista
apps/dev/src/event-chart/easy-travel-test-data.ts
TypeScript
ClassDeclaration
export class EasyTravelDataSource implements EventChartDemoDataSource { getEvents(): EventChartDemoEvent[] { return EASY_TRAVEL_TEST_DATA[0].data.map((obj) => ({ value: obj.x, duration: obj.source.actionDuration || 0, lane: obj.y.toString(), data: { name: (obj.source && obj.source...
PedroMosquera/barista
apps/dev/src/event-chart/easy-travel-test-data.ts
TypeScript
MethodDeclaration
getEvents(): EventChartDemoEvent[] { return EASY_TRAVEL_TEST_DATA[0].data.map((obj) => ({ value: obj.x, duration: obj.source.actionDuration || 0, lane: obj.y.toString(), data: { name: (obj.source && obj.source.name) || '', type: (obj.source && obj.source.type) || '', }...
PedroMosquera/barista
apps/dev/src/event-chart/easy-travel-test-data.ts
TypeScript
MethodDeclaration
getLanes(): EventChartDemoLane[] { const lanes: EventChartDemoLane[] = []; for (const event of EASY_TRAVEL_TEST_DATA[0].data) { const name = event.y.toString(); if (!lanes.find((l) => l.name === name)) { // tslint:disable-next-line: no-any let color: any = 'default'; if (eve...
PedroMosquera/barista
apps/dev/src/event-chart/easy-travel-test-data.ts
TypeScript
MethodDeclaration
getLegendItems(): EventChartDemoLegendItem[] { const lanesPerColor = new Map<string, EventChartDemoLegendItem>(); for (const lane of this.getLanes()) { const item = lanesPerColor.get(lane.color); if (item && item.lanes.indexOf(lane.name) === -1) { item.lanes.push(lane.name); } else if...
PedroMosquera/barista
apps/dev/src/event-chart/easy-travel-test-data.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { val: string = '🐘'; title = 'app works!'; emojiAdded(v) { this.val = v; } }
paramsinghvc/ng2-emojis
example/src/app/app.component.ts
TypeScript
MethodDeclaration
emojiAdded(v) { this.val = v; }
paramsinghvc/ng2-emojis
example/src/app/app.component.ts
TypeScript
ArrowFunction
() => { return ( <div> <Center> <StaticImage src="../../images/github-icon.png" alt="Github Icon" width={20} height={20} placeholder="blurred" /> </Center> </div>
SahilKr24/website-litmuschaos
src/components/image-fetch/GithubIcon.tsx
TypeScript
ArrowFunction
() => { this._eventObject.removeListener(this._name, callback) }
GeorgeTG/oni-types
src/index.ts
TypeScript
ClassDeclaration
export class Event<T> implements IEvent<T> { private _name: string private _eventObject: EventEmitter constructor(name: string) { this._name = name if (!eventsCache.has(name)) { let emitter = new EventEmitter() emitter.setMaxListeners(100) eventsCache.s...
GeorgeTG/oni-types
src/index.ts
TypeScript
InterfaceDeclaration
export interface IDisposable { dispose(): void }
GeorgeTG/oni-types
src/index.ts
TypeScript
InterfaceDeclaration
export interface IEvent<T> { subscribe(callback: EventCallback<T>): IDisposable }
GeorgeTG/oni-types
src/index.ts
TypeScript
TypeAliasDeclaration
export type DisposeFunction = () => void
GeorgeTG/oni-types
src/index.ts
TypeScript
TypeAliasDeclaration
export type EventCallback<T> = (value: T) => void
GeorgeTG/oni-types
src/index.ts
TypeScript
MethodDeclaration
public subscribe(callback: EventCallback<T>): IDisposable { this._eventObject.addListener(this._name, callback) const dispose = () => { this._eventObject.removeListener(this._name, callback) } return { dispose } }
GeorgeTG/oni-types
src/index.ts
TypeScript
MethodDeclaration
public dispatch(val?: T): void { this._eventObject.emit(this._name, val) }
GeorgeTG/oni-types
src/index.ts
TypeScript
ClassDeclaration
@Injectable({providedIn: 'root'}) export class UserService { constructor(private http: HttpClient) { } /** * Find users based on the given pagination parameters. * * @param size Page size. * @param page The number of the page. * @param sort Sort column. * @param direction ...
christoforosmagalios/base-app
base-app-ui/src/app/users/user.service.ts
TypeScript
MethodDeclaration
/** * Find users based on the given pagination parameters. * * @param size Page size. * @param page The number of the page. * @param sort Sort column. * @param direction Sort direction. */ findAll(size: number, page: number, sort: string, direction: string): Observable<PageDTO<UserDT...
christoforosmagalios/base-app
base-app-ui/src/app/users/user.service.ts
TypeScript
MethodDeclaration
/** * Get The User with the given id. * * @param id The User id. */ getUser(id: string): Observable<UserDTO> { return this.http.get<UserDTO>(Constants.API + '/users/' + id); }
christoforosmagalios/base-app
base-app-ui/src/app/users/user.service.ts
TypeScript
MethodDeclaration
/** * Save the given user. * * @param user The User to be saved. */ save(user: UserDTO) { return this.http.post<UserDTO>(Constants.API + '/users', user); }
christoforosmagalios/base-app
base-app-ui/src/app/users/user.service.ts
TypeScript
MethodDeclaration
/** * Delete the User with the given id. * * @param id The User id. */ delete(id: string): Observable<any> { return this.http.delete(Constants.API + '/users/' + id); }
christoforosmagalios/base-app
base-app-ui/src/app/users/user.service.ts
TypeScript
ArrowFunction
(props) => { const { form: { getFieldDecorator }, data, form } = props; const permissionType = [ { id: 'default', text: '默认' }, { id: 'system', text: '系统' }, { id: 'business', text: '业务功能' }, { id: 'api', text: 'API接口' }, { id: 'tenant', text: '多租户' } ]; var de...
13226633937/jetlinks-ui-antd
src/pages/system/permission/Save/basic/index.tsx
TypeScript
ArrowFunction
(topic: any, data: any) => { form.validateFields((err, fieldValue) => { if (err) { data.callback('error'); } else { // fieldValue.type = fieldValue.type.toString(); data.callback(fieldValue); } }); }
13226633937/jetlinks-ui-antd
src/pages/system/permission/Save/basic/index.tsx
TypeScript
ArrowFunction
(err, fieldValue) => { if (err) { data.callback('error'); } else { // fieldValue.type = fieldValue.type.toString(); data.callback(fieldValue); } }
13226633937/jetlinks-ui-antd
src/pages/system/permission/Save/basic/index.tsx
TypeScript
ArrowFunction
option => <Select.Option value
13226633937/jetlinks-ui-antd
src/pages/system/permission/Save/basic/index.tsx
TypeScript
InterfaceDeclaration
interface Props extends FormComponentProps { data: Partial<PermissionItem>; save: Function; }
13226633937/jetlinks-ui-antd
src/pages/system/permission/Save/basic/index.tsx
TypeScript
MethodDeclaration
getFieldDecorator('id', { initialValue: data
13226633937/jetlinks-ui-antd
src/pages/system/permission/Save/basic/index.tsx
TypeScript
MethodDeclaration
getFieldDecorator('name', { initialValue: data
13226633937/jetlinks-ui-antd
src/pages/system/permission/Save/basic/index.tsx
TypeScript
MethodDeclaration
getFieldDecorator('status', { initialValue: data
13226633937/jetlinks-ui-antd
src/pages/system/permission/Save/basic/index.tsx
TypeScript
MethodDeclaration
getFieldDecorator('properties.type', { initialValue:
13226633937/jetlinks-ui-antd
src/pages/system/permission/Save/basic/index.tsx
TypeScript
ArrowFunction
(size: Size): string => theme.borderWidth[size]
BArnaudet/Hackathon-Wild-Fest
src/styles/theme/helpers/border-width/borderWidth.ts
TypeScript
TypeAliasDeclaration
type Size = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
BArnaudet/Hackathon-Wild-Fest
src/styles/theme/helpers/border-width/borderWidth.ts
TypeScript
ClassDeclaration
export abstract class PartialAddressBase implements IPartialAddress { public readonly company: string; public readonly addressLines: ReadonlyArray<string>; public readonly cityLocality: string; public readonly stateProvince: string; public readonly postalCode: string; public readonly country?: Country; p...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/common/addresses/partial-address.ts
TypeScript
ClassDeclaration
export class PartialAddress extends PartialAddressBase { public static readonly [_internal] = { label: "address", schema: Joi.object({ company: Joi.string().trim().singleLine().allow("").max(100), addressLines: Joi.array().items(Joi.string().trim().singleLine().min(1).max(100)), cityLocalit...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/common/addresses/partial-address.ts
TypeScript
ArrowFunction
({ searchText, numberOfItems }) => this.api.fetch(searchText, numberOfItems)
Airblader/ngqp
projects/ngqp-demo/src/app/docs-items/usage-guide/snippets/use-model.example.ts
TypeScript
ArrowFunction
response => { // … }
Airblader/ngqp
projects/ngqp-demo/src/app/docs-items/usage-guide/snippets/use-model.example.ts
TypeScript
ArrowFunction
(props: { children: React.ReactNode, result: Result<string>|null, loading: boolean, onRequestClose: () => void, onSubmit: (e: React.FormEvent) => void, submitText?: string, title: string, submitDanger?:boolean, cancelText?: string, }) => ( <Modal title={props.title}
dmitris/ashirt-server
frontend/src/components/modal_form/index.tsx
TypeScript
ArrowFunction
() => { it(`can be constructed with CustomFontEmbedder.for(...)`, async () => { const embedder = await CustomFontEmbedder.for(fontkit, ubuntuFont); expect(embedder).toBeInstanceOf(CustomFontEmbedder); }); it(`exposes the font's name`, async () => { const embedder = await CustomFontEmbedder.for( ...
GerardSmit/pdf-lib
tests/core/embedders/CustomFontEmbedder.spec.ts
TypeScript
ArrowFunction
async () => { const embedder = await CustomFontEmbedder.for(fontkit, ubuntuFont); expect(embedder).toBeInstanceOf(CustomFontEmbedder); }
GerardSmit/pdf-lib
tests/core/embedders/CustomFontEmbedder.spec.ts
TypeScript
ArrowFunction
async () => { const embedder = await CustomFontEmbedder.for( fontkit, new Uint8Array(ubuntuFont), ); expect(embedder.fontName).toBe('Ubuntu'); }
GerardSmit/pdf-lib
tests/core/embedders/CustomFontEmbedder.spec.ts
TypeScript
ArrowFunction
async () => { const context = PDFContext.create(); const embedder = await CustomFontEmbedder.for( fontkit, new Uint8Array(ubuntuFont), ); expect(context.enumerateIndirectObjects().length).toBe(0); const ref = await embedder.embedIntoContext(context); expect(context.enumerateIndirec...
GerardSmit/pdf-lib
tests/core/embedders/CustomFontEmbedder.spec.ts
TypeScript
ArrowFunction
async () => { const context = PDFContext.create(); const predefinedRef = PDFRef.of(9999); const embedder = await CustomFontEmbedder.for( fontkit, new Uint8Array(ubuntuFont), ); expect(context.enumerateIndirectObjects().length).toBe(0); const ref = await embedder.embedIntoContext(co...
GerardSmit/pdf-lib
tests/core/embedders/CustomFontEmbedder.spec.ts
TypeScript
ArrowFunction
async () => { const text = 'Stuff and thingz!'; const hexCodes = '00360057005801AA000300440051004700030057004B004C0051004A005D0004'; const embedder = await CustomFontEmbedder.for(fontkit, ubuntuFont); expect(embedder.encodeText(text)).toBeInstanceOf(PDFHexString); expect(String(embedder.enco...
GerardSmit/pdf-lib
tests/core/embedders/CustomFontEmbedder.spec.ts
TypeScript
ArrowFunction
async () => { const text = 'Stuff and thingz!'; const embedder = await CustomFontEmbedder.for(fontkit, ubuntuFont); expect(embedder.widthOfTextAtSize(text, 12)).toBe(90.672); expect(embedder.widthOfTextAtSize(text, 24)).toBe(181.344); }
GerardSmit/pdf-lib
tests/core/embedders/CustomFontEmbedder.spec.ts
TypeScript
ArrowFunction
async () => { const embedder = await CustomFontEmbedder.for(fontkit, ubuntuFont); expect(embedder.heightOfFontAtSize(12)).toBeCloseTo(13.452); expect(embedder.heightOfFontAtSize(24)).toBeCloseTo(26.904); }
GerardSmit/pdf-lib
tests/core/embedders/CustomFontEmbedder.spec.ts
TypeScript
ArrowFunction
async () => { const embedder = await CustomFontEmbedder.for(fontkit, ubuntuFont); expect(embedder.sizeOfFontAtHeight(12)).toBeCloseTo(10.705); expect(embedder.sizeOfFontAtHeight(24)).toBeCloseTo(21.409); }
GerardSmit/pdf-lib
tests/core/embedders/CustomFontEmbedder.spec.ts
TypeScript