type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ClassDeclaration |
export default class Relaxiprange extends SfdxCommand {
public connectedapp_consumerKey: string;
public static description = messages.getMessage("commandDescription");
public static examples = [
`sfdx sfpowerkit:org:relaxiprange -u sandbox -r "122.0.0.0-122.255.255.255,49.0.0.0-49.255.255.255"`
];
prot... | azlam-abdulsalam/sfpowerkit | src/commands/sfpowerkit/org/relaxiprange.ts | TypeScript |
MethodDeclaration |
public async run(): Promise<AnyJson> {
SFPowerkit.setLogLevel(this.flags.loglevel, this.flags.json);
let ipRangeToSet = this.flags.range.map(function(element: string) {
let range = element.split("-");
return { start: range[0], end: range[1] };
});
return await RelaxIPRangeImpl.setIp(
... | azlam-abdulsalam/sfpowerkit | src/commands/sfpowerkit/org/relaxiprange.ts | TypeScript |
ClassDeclaration |
export default abstract class WSCommand {
static get schema(): WSSchema.TV4;
static get CommandClasses(): {
[key: string]: WSCommandConstructor;
};
get WSCommandNotFoundError(): typeof WSCommandNotFoundError;
static addCommandClass(name: string, classObj: WSCommandConstructor): void;
st... | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
ClassDeclaration |
declare class WSCommandNotFoundError extends Error {
} | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
TypeAliasDeclaration |
declare type WSCommandConstructor = new () => WSCommand; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
static addCommandClass(name: string, classObj: WSCommandConstructor): void; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
static framed(module: any, func: any, payload: any): Uint8Array; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
static dequeueOne(buf: any): {
module: any;
func: any;
payload: any;
next: any;
} | null; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
static compress(wscommands: any, json: any): Uint8Array | null; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
setHw(obj: any): void; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
sendCommand(func: any, payload: any): void; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
parseFromJson(json: any): void; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
notifyFromBinary(objToSend: any, func: any, payload: any): void; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
envelopWarning(objToSend: any, module_key: any, obj: any): void; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
envelopError(objToSend: any, module_key: any, obj: any): void; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
isValidIO(io: any): boolean; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
getSchema(uri: any): WSSchema.JsonSchema; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
validateCommandSchema(uriList: any, json: any, rootPath: any, customArg: any): any; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
validate(commandUri: any, json: any): WSSchema.MultiResult; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
fastValidate(commandUri: any, json: any): boolean; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
onlyTypeErrorMessage(validateError: any, rootPath: any): any; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
filter(commandUri: any, json: any): any; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
MethodDeclaration |
_filterSchema(schema: any, json: any): any; | 610t/obniz | dist/src/obniz/libs/wscommand/WSCommand.d.ts | TypeScript |
ArrowFunction |
async () => {
// Airdropping tokens to a payer.
await provider.connection.confirmTransaction(
await provider.connection.requestAirdrop(payer.publicKey, 10000000000),
"confirmed"
);
mintA = await Token.createMint(
provider.connection,
payer,
mintAuthority.publicKey,
... | konrads/anchor | tests/escrow/tests/escrow.ts | TypeScript |
ArrowFunction |
async () => {
await program.rpc.initializeEscrow(
new BN(initializerAmount),
new BN(takerAmount),
{
accounts: {
initializer: provider.wallet.publicKey,
initializerDepositTokenAccount: initializerTokenAccountA,
initializerReceiveTokenAccount: initializerTokenA... | konrads/anchor | tests/escrow/tests/escrow.ts | TypeScript |
ArrowFunction |
async () => {
await program.rpc.exchange({
accounts: {
taker: provider.wallet.publicKey,
takerDepositTokenAccount: takerTokenAccountB,
takerReceiveTokenAccount: takerTokenAccountA,
pdaDepositTokenAccount: initializerTokenAccountA,
initializerReceiveTokenAccount: initia... | konrads/anchor | tests/escrow/tests/escrow.ts | TypeScript |
ArrowFunction |
async () => {
let newEscrow = Keypair.generate();
// Put back tokens into initializer token A account.
await mintA.mintTo(
initializerTokenAccountA,
mintAuthority.publicKey,
[mintAuthority],
initializerAmount
);
await program.rpc.initializeEscrow(
new BN(initializerA... | konrads/anchor | tests/escrow/tests/escrow.ts | TypeScript |
TypeAliasDeclaration |
type EscrowAccount = IdlAccounts<Escrow>["escrowAccount"]; | konrads/anchor | tests/escrow/tests/escrow.ts | TypeScript |
ClassDeclaration |
export class ReportsBalancesFetchAllFailed extends BaseError {
public name = 'ReportsBalancesFetchAllFailed'
constructor (
public message: string = 'Could not fetch all the balances',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, ReportsBalancesFe... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class ReportsBalancesFetchOneFailed extends BaseError {
public name = 'ReportsBalancesFetchOneFailed'
constructor (
public message: string = 'Could not fetch one balance',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, ReportsBalancesFetchOn... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class ReportsBalancesMetaFailed extends BaseError {
public name = 'ReportsBalancesMetaFailed'
constructor (
public message: string = 'Could not fetch meta data for balances',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, ReportsBalancesMeta... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class ReportsPaymentOptionsFetchAllFailed extends BaseError {
public name = 'ReportsPaymentOptionsFetchAllFailed'
constructor (
public message: string = 'Could not fetch all the payment options',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class ReportsPaymentOptionsMetaFailed extends BaseError {
public name = 'ReportsPaymentOptionsMetaFailed'
constructor (
public message: string = 'Could not fetch meta the payment options',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, Repor... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class ReportsPaymentsFetchAllFailed extends BaseError {
public name = 'ReportsPaymentsFetchAllFailed'
constructor (
public message: string = 'Could not fetch all the payments',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, ReportsPaymentsFe... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class ReportsPaymentsMetaFailed extends BaseError {
public name = 'ReportsPaymentsMetaFailed'
constructor (
public message: string = 'Could not fetch meta data for payments',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, ReportsPaymentsMeta... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class VatReportFetchFailed extends BaseError {
public name = 'VatReportFetchFailed'
constructor (
public message: string = 'Could not fetch the vat report',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, VatReportFetchFailed.prototype)
}
} | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class VatReportFetchMetaFailed extends BaseError {
public name = 'VatReportFetchMetaFailed'
constructor (
public message: string = 'Could not fetch meta data for vat report',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, VatReportFetchMetaF... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class CustomerFetchFailed extends BaseError {
public name = 'CustomerFetchFailed'
constructor (
public message: string = 'Could not fetch customer report',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, CustomerFetchFailed.prototype)
}
} | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class CustomerFilterFetchFailed extends BaseError {
public name = 'CustomerFilterFetchFailed'
constructor (
public message: string = 'Could not fetch customer filters',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, CustomerFilterFetchFailed... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class CustomerTransactionFetchFailed extends BaseError {
public name = 'CustomerTransactionFetchFailed'
constructor (
public message: string = 'Could not fetch customer report transactions',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, Cus... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class CustomerOverviewFetchFailed extends BaseError {
public name = 'CustomerOverviewFetchFailed'
constructor (
public message: string = 'Could not fetch customer report overview',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, CustomerOverv... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
ClassDeclaration |
export class CustomersMetaFailed extends BaseError {
public name = 'CustomersMetaFailed'
constructor (
public message: string = 'Could not fetch customer report metadata',
properties?: Record<string, unknown>
) {
super(message, properties)
Object.setPrototypeOf(this, CustomersMetaFailed.prototype... | donut87/tillhub-sdk-javascript | src/errors/analytics.ts | TypeScript |
EnumDeclaration |
export enum TextureKeys {
Drol = "drol",
} | markhigham/learning-phaser-1 | src/consts/TextureKeys.ts | TypeScript |
FunctionDeclaration |
export async function updated({
paths,
contractsBuildDirectory,
}: UpdatedOptions): Promise<string[]> {
const sourceFilesArtifacts = readAndParseArtifactFiles(
paths,
contractsBuildDirectory
);
const sourceFilesArtifactsUpdatedTimes = minimumUpdatedTimePerSource(
sourceFilesArtifacts
);
retur... | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
FunctionDeclaration |
function readAndParseArtifactFiles(
paths: string[],
contracts_build_directory: string
): SourceFilesArtifacts {
const sourceFilesArtifacts: SourceFilesArtifacts = {};
// Get all the source files and create an object out of them.
paths.forEach((sourceFile) => {
sourceFilesArtifacts[sourceFile] = [];
})... | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
FunctionDeclaration |
function findUpdatedFiles(
sourceFilesArtifacts: SourceFilesArtifacts,
sourceFilesArtifactsUpdatedTimes: SourceFilesArtifactsUpdatedTimes
): string[] {
// Stat all the source files, getting there updated times, and comparing them to
// the artifact updated times.
const sourceFiles = Object.keys(sourceFilesAr... | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
FunctionDeclaration |
function minimumUpdatedTimePerSource(
sourceFilesArtifacts: SourceFilesArtifacts
) {
let sourceFilesArtifactsUpdatedTimes: SourceFilesArtifactsUpdatedTimes = {};
// Get the minimum updated time for all of a source file's artifacts
// (note: one source file might have multiple artifacts).
for (const sourceFil... | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
ArrowFunction |
(sourceFile) => {
sourceFilesArtifacts[sourceFile] = [];
} | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
ArrowFunction |
(file) => path.extname(file) === ".json" | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
ArrowFunction |
(file) => {
const body = fs.readFileSync(
path.join(contracts_build_directory, file),
"utf8"
);
return { file, body };
} | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
ArrowFunction |
(file) => {
try {
return fs.statSync(file);
} catch (error) {
// Ignore it. This means the source file was removed
// but the artifact file possibly exists. Return null
// to signfy that we should ignore it.
return null;
}
} | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
ArrowFunction |
(sourceFile, index) => {
const sourceFileStat = sourceFileStats[index];
// Ignore updating artifacts if source file has been removed.
if (sourceFileStat == null) return;
const artifactsUpdatedTime =
sourceFilesArtifactsUpdatedTimes[sourceFile] || 0;
const sourceFileUpdatedTime =... | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
ArrowFunction |
(file) => file | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
ArrowFunction |
(minimum, current) => {
const updatedAt = new Date(current.updatedAt).getTime();
if (updatedAt < minimum) {
return updatedAt;
}
return minimum;
} | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
InterfaceDeclaration |
export interface UpdatedOptions {
paths: string[];
contractsBuildDirectory: string;
} | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
InterfaceDeclaration |
interface SourceFilesArtifacts {
[filePath: string]: ContractObject[];
} | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
InterfaceDeclaration |
interface SourceFilesArtifactsUpdatedTimes {
[filePath: string]: number; // ms since epoch
} | Balammetaverso/truffle | packages/profiler/src/updated.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'dt-example-tabs-dynamic',
templateUrl: './tabs-dynamic-example.html',
})
export class DtExampleTabsDynamic {
hasProblems = false;
} | alexlagler/barista | libs/examples/src/tabs/tabs-dynamic-example/tabs-dynamic-example.ts | TypeScript |
FunctionDeclaration |
export default function requireSession(
cb: (session: Session) => AsyncNextApiHandler
): AsyncNextApiHandler {
return async (req, res) => {
const session = getSessionCookie(req, res)
if (!session) {
res.status(401).end('Unauthorized')
} else {
return cb(session)(req, res)
}
}
} | covid-modeling/web-ui | pages/api/util/require-session.ts | TypeScript |
ArrowFunction |
async (req, res) => {
const session = getSessionCookie(req, res)
if (!session) {
res.status(401).end('Unauthorized')
} else {
return cb(session)(req, res)
}
} | covid-modeling/web-ui | pages/api/util/require-session.ts | TypeScript |
ArrowFunction |
() => Yup.object().shape({
otp: Yup.string().required("OTP is required")
.matches(/^[0-9]+$/, "OTP must contain only digits."),
}) | kartikeyvaish/Kolegia_Mobile | schema/OTPSchema.ts | TypeScript |
FunctionDeclaration |
function main([tsconfigPath, output, target, attrsStr]: string[]): 0|1 {
// The Bazel ts_project attributes were json-encoded
// (on Windows the quotes seem to be quoted wrong, so replace backslash with quotes :shrug:)
const attrs = JSON.parse(attrsStr.replace(/\\/g, '"'));
// Parse your typescript settings f... | arifogel/rules_nodejs | packages/typescript/internal/ts_project_options_validator.ts | TypeScript |
FunctionDeclaration |
function getTsOption(option) {
if (typeof (options[option]) === 'string') {
// Currently the only string-typed options are filepaths.
// TypeScript will resolve these to a project path
// so when echoing that back to the user, we need to reverse that resolution.
// First turn //path/to/pkg:... | arifogel/rules_nodejs | packages/typescript/internal/ts_project_options_validator.ts | TypeScript |
FunctionDeclaration |
function check(option: string, attr?: string) {
attr = attr || option;
// treat compilerOptions undefined as false
const optionVal = getTsOption(option);
const match = optionVal === attrs[attr] ||
(optionVal === undefined && (attrs[attr] === false || attrs[attr] === ''));
if (!match) {
... | arifogel/rules_nodejs | packages/typescript/internal/ts_project_options_validator.ts | TypeScript |
FunctionDeclaration |
function check_preserve_jsx() {
const attr = 'preserve_jsx'
const jsxVal = options['jsx'] as ts.JsxEmit
if ((jsxVal === ts.JsxEmit.Preserve) !== Boolean(attrs[attr])) {
failures.push(
`attribute ${attr}=${attrs[attr]} does not match compilerOptions.jsx=${jsxEmit[jsxVal]}`);
buildozerC... | arifogel/rules_nodejs | packages/typescript/internal/ts_project_options_validator.ts | TypeScript |
ArrowFunction |
() => ts.sys.getCurrentDirectory() | arifogel/rules_nodejs | packages/typescript/internal/ts_project_options_validator.ts | TypeScript |
ArrowFunction |
(f: string) => f | arifogel/rules_nodejs | packages/typescript/internal/ts_project_options_validator.ts | TypeScript |
ArrowFunction |
e => e.code !== 18002 && e.code !== 18003 | arifogel/rules_nodejs | packages/typescript/internal/ts_project_options_validator.ts | TypeScript |
ArrowFunction |
d => d.startsWith(process.env['BINDIR']) | arifogel/rules_nodejs | packages/typescript/internal/ts_project_options_validator.ts | TypeScript |
ArrowFunction |
f => console.error(' - ' + f) | arifogel/rules_nodejs | packages/typescript/internal/ts_project_options_validator.ts | TypeScript |
ArrowFunction |
c => `'${c}'` | arifogel/rules_nodejs | packages/typescript/internal/ts_project_options_validator.ts | TypeScript |
InterfaceDeclaration |
interface JQuery {
dxAccordion(): JQuery;
dxAccordion(options: "instance"): DevExpress.ui.dxAccordion;
dxAccordion(options: string): any;
dxAccordion(options: string, ...params: any[]): any;
dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery;
} | raskolnikova/infomaps | node_modules/devextreme/ui/accordion.d.ts | TypeScript |
FunctionDeclaration |
function is_math_like(text: string): boolean {
for (const c of new Set(text)) {
if ("0" <= c && c <= "9")
continue
switch (c) {
case ",":
case ".":
case "+":
case "-":
case "\u2212":
case "e":
... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
() => {
const canvas = document.createElement("canvas")
const ctx = canvas.getContext("2d")!
let current_font = ""
return (text: string, font: string): number => {
if (font != current_font) {
current_font = font
ctx.font = font
}
return ctx.measureText(text).width
}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
(text: string, font: string): number => {
if (font != current_font) {
current_font = font
ctx.font = font
}
return ctx.measureText(text).width
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
() => {
switch (baseline) {
case "top": return "top"
case "middle": return "center"
case "bottom": return "bottom"
default: return "baseline"
}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
() => {
switch (metric) {
case "x":
case "x_descent":
return fmetrics.x_height
case "cap":
case "cap_descent":
return fmetrics.cap_height
case "ascent":
case "ascent_descent":
return fmetrics.ascent
}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
() => {
switch (metric) {
case "x":
case "cap":
case "ascent":
return 0
case "x_descent":
case "cap_descent":
case "ascent_descent":
return fmetrics.descent
}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
(line) => text_width(line, font) | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
() => {
if (isNumber(x_anchor))
return x_anchor*width
else {
switch (x_anchor) {
case "left": return 0
case "center": return 0.5*width
case "right": return width
}
}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
() => {
if (isNumber(y_anchor))
return y_anchor*height
else {
switch (y_anchor) {
case "top": return 0
case "center": return 0.5*height
case "bottom": return height
case "baseline": {
if (nlines == 1) {
const metric = this.te... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
(word) => text_width(word, font) | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
() => {
switch (align == "auto" ? this._visual_align : align) {
case "left": return 0
case "center": return 0.5*(width - widths[i])
case "right": return width - widths[i]
}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
() => {
if (isNumber(y_anchor))
return y_anchor*height
else {
switch (y_anchor) {
case "top": return 0
case "center": return 0.5*height
case "bottom": return height
case "baseline": return 0.5*height /* TODO */
}
}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
(item) => item.infer_text_height() | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ArrowFunction |
(metric) => metric_map[metric] | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ClassDeclaration |
export abstract class GraphicsBox {
_position: Position = {sx: 0, sy: 0}
angle?: number
width?: {value: number, unit: "%"}
height?: {value: number, unit: "%"}
padding?: Padding
font_size_scale: number = 1.0
text_height_metric?: TextHeightMetric
align: "auto" | "left" | "center" | "right" | "justify" = ... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ClassDeclaration |
export class BaseExpo extends GraphicsBox {
constructor(readonly base: GraphicsBox, readonly expo: GraphicsBox) {
super()
}
get children(): GraphicsBox[] {
return [this.base, this.expo]
}
override set base_font_size(v: number) {
super.base_font_size = v
this.base.base_font_size = v
this... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ClassDeclaration |
export class GraphicsBoxes {
constructor(readonly items: GraphicsBox[]) {}
set base_font_size(v: number | null | undefined) {
for (const item of this.items) {
item.base_font_size = v
}
}
get length(): number {
return this.items.length
}
set visuals(v: visuals.Text["Values"] | visuals.L... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
TypeAliasDeclaration |
export type Position = {
sx: number
sy: number
x_anchor?: number | "left" | "center" | "right"
y_anchor?: number | "top" | "center" | "baseline" | "bottom"
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
TypeAliasDeclaration |
type Val = number | {value: number, unit: "px" | "%"} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
TypeAliasDeclaration |
type Extents = {left: Val, right: Val, top: Val, bottom: Val} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
TypeAliasDeclaration |
type Padding = Val | [v: Val, h: Val] | [top: Val, right: Val, bottom: Val, left: Val] | Extents | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
TypeAliasDeclaration |
export type TextHeightMetric = "x" | "cap" | "ascent" | "x_descent" | "cap_descent" | "ascent_descent" | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
abstract _rect(): Rect | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
abstract _size(): Size | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
abstract paint(ctx: Context2d): void | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
infer_text_height(): TextHeightMetric {
return "ascent_descent"
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
bbox(): BBox {
const {p0, p1, p2, p3} = this.rect()
const left = Math.min(p0.x, p1.x, p2.x, p3.x)
const top = Math.min(p0.y, p1.y, p2.y, p3.y)
const right = Math.max(p0.x, p1.x, p2.x, p3.x)
const bottom = Math.max(p0.y, p1.y, p2.y, p3.y)
return new BBox({left, right, top, bottom})
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
size(): Size {
const {width, height} = this._size()
const {angle} = this
if (!angle)
return {width, height}
else {
const c = Math.cos(Math.abs(angle))
const s = Math.sin(Math.abs(angle))
return {
width: Math.abs(width*c + height*s),
height: Math.abs(width*s + he... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.