type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
rect(): Rect {
const rect = this._rect()
const {angle} = this
if (!angle)
return rect
else {
const {sx, sy} = this.position
const tr = new AffineTransform()
tr.translate(sx, sy)
tr.rotate(angle)
tr.translate(-sx, -sy)
return tr.apply_rect(rect)
}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
paint_rect(ctx: Context2d): void {
const {p0, p1, p2, p3} = this.rect()
ctx.save()
ctx.strokeStyle = "red"
ctx.lineWidth = 1
ctx.beginPath()
const {round} = Math
ctx.moveTo(round(p0.x), round(p0.y))
ctx.lineTo(round(p1.x), round(p1.y))
ctx.lineTo(round(p2.x), round(p2.y))
ctx.li... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
paint_bbox(ctx: Context2d): void {
const {x, y, width, height} = this.bbox()
ctx.save()
ctx.strokeStyle = "blue"
ctx.lineWidth = 1
ctx.beginPath()
const {round} = Math
ctx.moveTo(round(x), round(y))
ctx.lineTo(round(x), round(y + height))
ctx.lineTo(round(x + width), round(y + heigh... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
override infer_text_height() {
if (this.text.includes("\n"))
return "ascent_descent"
else {
function is_math_like(text: string): boolean {
for (const c of new Set(text)) {
if ("0" <= c && c <= "9")
continue
switch (c) {
case ",":
case ... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
_text_line(fmetrics: FontMetrics): {height: number, ascent: number, descent: number} {
const metric = this.text_height_metric ?? this.infer_text_height()
const ascent = (() => {
switch (metric) {
case "x":
case "x_descent":
return fmetrics.x_height
case "cap":
c... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
_size(): Size & {metrics: FontMetrics} {
const {font} = this
const fmetrics = font_metrics(font)
const line_spacing = (this.line_height - 1)*fmetrics.height // TODO: max(trailing(L[n-1]), leading(L[n]))
const empty = this.text == ""
const lines = this.text.split("\n")
const nlines = lines.len... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
_computed_position(size: Size, metrics: FontMetrics, nlines: number): {x: number, y: number} {
const {width, height} = size
const {sx, sy, x_anchor=this._x_anchor, y_anchor=this._y_anchor} = this.position
const x = sx - (() => {
if (isNumber(x_anchor))
return x_anchor*width
else {
... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
_rect(): Rect {
const {width, height, metrics} = this._size()
const nlines = this.text.split("\n").length
const {x, y} = this._computed_position({width, height}, metrics, nlines)
const bbox = new BBox({x, y, width, height})
return bbox.rect
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
paint(ctx: Context2d): void {
const {font} = this
const fmetrics = font_metrics(font)
const line_spacing = (this.line_height - 1)*fmetrics.height // TODO: see above
const lines = this.text.split("\n")
const nlines = lines.length
const widths = lines.map((line) => text_width(line, font))
... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
_shift_scale(): number {
if (this.base instanceof TextBox && this.base.nlines == 1) {
const {x_height, cap_height} = font_metrics(this.base.font)
return x_height/cap_height
} else {
return 2/3
}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
override infer_text_height() {
return this.base.infer_text_height()
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
_rect(): Rect {
const bb = this.base.bbox()
const eb = this.expo.bbox()
const bbox = bb.union(eb)
const {x, y} = this._computed_position()
return bbox.translate(x, y).rect
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
_size(): Size {
const bs = this.base.size()
const es = this.expo.size()
return {
width: bs.width + es.width,
height: Math.max(bs.height, this._shift_scale()*bs.height + es.height),
}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
paint(ctx: Context2d): void {
ctx.save()
const {angle} = this
if (angle) {
const {sx, sy} = this.position
ctx.translate(sx, sy)
ctx.rotate(angle)
ctx.translate(-sx, -sy)
}
const {x, y} = this._computed_position()
ctx.translate(x, y)
this.base.paint(ctx)
this.expo... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration | // paint_rect ...
override paint_bbox(ctx: Context2d): void {
super.paint_bbox(ctx)
const {x, y} = this._computed_position()
ctx.save()
ctx.translate(x, y)
for (const child of this.children) {
child.paint_bbox(ctx)
}
ctx.restore()
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
_computed_position(): {x: number, y: number} {
const {width, height} = this._size()
const {sx, sy, x_anchor=this._x_anchor, y_anchor=this._y_anchor} = this.position
const x = sx - (() => {
if (isNumber(x_anchor))
return x_anchor*width
else {
switch (x_anchor) {
case "... | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
MethodDeclaration |
max_size(): Size {
let width = 0
let height = 0
for (const item of this.items) {
const size = item.size()
width = Math.max(width, size.width)
height = Math.max(height, size.height)
}
return {width, height}
} | Nikhil-Chandra-Paul/bokeh | bokehjs/src/lib/core/graphics.ts | TypeScript |
ClassDeclaration |
class FormRule_Item extends DevKit.IForm {
/**
* DynamicsCrm.DevKit form Rule_Item
* @param executionContext the execution context
* @param defaultWebResourceName default resource name. E.g.: "devkit_/resources/Resource"
*/
constructor(executionContext: any, defaultWebResourceName?: string);
/** Utility ... | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
ClassDeclaration |
class RoutingRuleItemApi {
/**
* DynamicsCrm.DevKit RoutingRuleItemApi
* @param entity The entity object
*/
constructor(entity?: any);
/**
* Get the value of alias
* @param alias the alias value
* @param isMultiOptionSet true if the alias is multi OptionSet
*/
getAliasedValue(alias: string, i... | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
InterfaceDeclaration |
interface Header extends DevKit.Controls.IHeader {
/** Unique identifier for Routing Rule associated with Rule Item. */
RoutingRuleId: DevKit.Controls.Lookup;
} | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
InterfaceDeclaration |
interface tab_General_Sections {
ConditionControl: DevKit.Controls.Section;
ConditionControl_uc: DevKit.Controls.Section;
Rule_Item_Information: DevKit.Controls.Section;
Then_Condition: DevKit.Controls.Section;
} | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
InterfaceDeclaration |
interface tab_notes_Sections {
notes: DevKit.Controls.Section;
} | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
InterfaceDeclaration |
interface tab_General extends DevKit.Controls.ITab {
Section: tab_General_Sections;
} | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
InterfaceDeclaration |
interface tab_notes extends DevKit.Controls.ITab {
Section: tab_notes_Sections;
} | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
InterfaceDeclaration |
interface Tabs {
General: tab_General;
notes: tab_notes;
} | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
InterfaceDeclaration |
interface Body {
Tab: Tabs;
appConditionBuilder_uc: DevKit.Controls.ActionCards;
/** Look for user/team records or create a new record. */
AssignObjectId: DevKit.Controls.Lookup;
/** Provide a description for the rule item. */
Description: DevKit.Controls.String;
/** Choose if you want to route th... | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
EnumDeclaration |
enum ComponentState {
/** 2 */
Deleted,
/** 3 */
Deleted_Unpublished,
/** 0 */
Published,
/** 1 */
Unpublished
} | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
EnumDeclaration |
enum msdyn_routeto {
/** 1 */
Queue,
/** 2 */
UserTeam
} | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
EnumDeclaration |
enum RollupState {
/** 0 - Attribute value is yet to be calculated */
NotCalculated,
/** 1 - Attribute value has been calculated per the last update time in <AttributeSchemaName>_Date attribute */
Calculated,
/** 2 - Attribute value calculation lead to overfl... | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
MethodDeclaration | /**
* Get the value of alias
* @param alias the alias value
* @param isMultiOptionSet true if the alias is multi OptionSet
*/
getAliasedValue(alias: string, isMultiOptionSet?: boolean): any; | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
MethodDeclaration | /**
* Get the formatted value of alias
* @param alias the alias value
* @param isMultiOptionSet true if the alias is multi OptionSet
*/
getAliasedFormattedValue(alias: string, isMultiOptionSet?: boolean): string; | Kayserheimer/Dynamics-Crm-DevKit | test/v.2.12.31/TestAllEntities/All-DEMO/Dev.DevKit.WebResource/entities/RoutingRuleItem.d.ts | TypeScript |
FunctionDeclaration |
export function DocViewTableRowIconUnderscore() {
const ariaLabel = i18n.translate(
'discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedAriaLabel',
{
defaultMessage: 'Warning',
}
);
const tooltipContent = i18n.translate(
'discover.docViews.table.fieldNamesBeginningWithUnder... | AlexCornigeanu/kibana | src/plugins/discover/public/components/table/table_row_icon_underscore.tsx | TypeScript |
ClassDeclaration |
export class UpdateUserDto extends PartialType(CreateUserDto) {
@IsNotEmpty({ message: 'Tên không được trống' })
@Length(5, 25, { message: 'Tên từ 5 - 25 kí tự' })
username: string;
@IsNotEmpty({ message: 'Mật khẩu không được trống' })
@Length(6, 18, { message: 'Mật khẩu từ 6 - 18 kí tự' })
password: stri... | phuongk62uet99/api-directory | src/users/dto/update-user.dto.ts | TypeScript |
ArrowFunction |
(count) => {
this.setState({
visible: count > 0,
});
} | AMoo-Miki/OpenSearch-Dashboards | src/core/public/chrome/ui/loading_indicator.tsx | TypeScript |
ClassDeclaration |
export class LoadingIndicator extends React.Component<LoadingIndicatorProps, { visible: boolean }> {
public static defaultProps = { showAsBar: false };
private loadingCountSubscription?: Subscription;
state = {
visible: false,
};
componentDidMount() {
this.loadingCountSubscription = this.props.loa... | AMoo-Miki/OpenSearch-Dashboards | src/core/public/chrome/ui/loading_indicator.tsx | TypeScript |
InterfaceDeclaration |
export interface LoadingIndicatorProps {
loadingCount$: ReturnType<HttpStart['getLoadingCount$']>;
showAsBar?: boolean;
} | AMoo-Miki/OpenSearch-Dashboards | src/core/public/chrome/ui/loading_indicator.tsx | TypeScript |
MethodDeclaration |
componentDidMount() {
this.loadingCountSubscription = this.props.loadingCount$.subscribe((count) => {
this.setState({
visible: count > 0,
});
});
} | AMoo-Miki/OpenSearch-Dashboards | src/core/public/chrome/ui/loading_indicator.tsx | TypeScript |
MethodDeclaration |
componentWillUnmount() {
if (this.loadingCountSubscription) {
this.loadingCountSubscription.unsubscribe();
this.loadingCountSubscription = undefined;
}
} | AMoo-Miki/OpenSearch-Dashboards | src/core/public/chrome/ui/loading_indicator.tsx | TypeScript |
MethodDeclaration |
render() {
const className = classNames(!this.state.visible && 'osdLoadingIndicator-hidden');
const testSubj = this.state.visible
? 'globalLoadingIndicator'
: 'globalLoadingIndicator-hidden';
const ariaHidden = this.state.visible ? false : true;
const ariaLabel = i18n.translate('core.ui.... | AMoo-Miki/OpenSearch-Dashboards | src/core/public/chrome/ui/loading_indicator.tsx | TypeScript |
InterfaceDeclaration | /**
* ShimmeredDetailsList props interface
* {@docCategory ShimmeredDetailsList}
*/
export interface IShimmeredDetailsListProps extends IDetailsListProps {
/**
* Boolean flag to control when to render placeholders vs real items.
* It's up to the consumer app to know when fetching of the data is done to toggl... | jeremy-coleman/office-react-mono-simplified | src/office-ui-fabric-react/components/DetailsList/ShimmeredDetailsList.types.ts | TypeScript |
InterfaceDeclaration | /**
* Represents the stylable areas of the control.
* @internal
*/
export interface IShimmeredDetailsListStyles {
/**
* Represents styles passed to the `List` component for creating a fade-out to the bottom overlay.
*/
root: IStyle;
} | jeremy-coleman/office-react-mono-simplified | src/office-ui-fabric-react/components/DetailsList/ShimmeredDetailsList.types.ts | TypeScript |
TypeAliasDeclaration | /**
* Defines props needed to construct styles. This represents the simplified set of immutable things which control the class names.
* @internal
*/
export type IShimmeredDetailsListStyleProps = Required<Pick<IShimmeredDetailsListProps, 'theme'>>; | jeremy-coleman/office-react-mono-simplified | src/office-ui-fabric-react/components/DetailsList/ShimmeredDetailsList.types.ts | TypeScript |
ArrowFunction |
(data: {}) => {
this.storeata = data;
} | LaCasaDeProgramacion/crmangular | src/app/back/pages/stores/edit-store/edit-store.component.ts | TypeScript |
ArrowFunction |
data => {
this.router.navigate(['/home'])
} | LaCasaDeProgramacion/crmangular | src/app/back/pages/stores/edit-store/edit-store.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-edit-store',
templateUrl: './edit-store.component.html',
styleUrls: ['./edit-store.component.scss']
})
export class EditStoreComponent implements OnInit {
store_id = this.actRoute.snapshot.params['store_id'];
storeata: any = {};
constructor( public restApi: ApiStore,
publ... | LaCasaDeProgramacion/crmangular | src/app/back/pages/stores/edit-store/edit-store.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.restApi.findStorebyId(this.store_id).subscribe((data: {}) => {
this.storeata = data;
})
} | LaCasaDeProgramacion/crmangular | src/app/back/pages/stores/edit-store/edit-store.component.ts | TypeScript |
MethodDeclaration |
updateEmployee() {
if(window.confirm('Are you sure, you want to update?')){
this.restApi.updateStore(this.store_id, this.storeata).subscribe(data => {
this.router.navigate(['/home'])
})
}
} | LaCasaDeProgramacion/crmangular | src/app/back/pages/stores/edit-store/edit-store.component.ts | TypeScript |
FunctionDeclaration | /**
* @typedef {(
* file: StoreFile,
* start?: number | undefined,
* end?: number | undefined
* ) => Promise<{
* stream: NodeJS.ReadableStream,
* cacheControl: string,
* }>} GetStreamFn
*/
/**
* @typedef {import("../types/advanced-types").Postgres} Postgres
*/
/**
* @typedef {import("../ty... | compasjs/compas | packages/store/src/send-transformed-image.d.ts | TypeScript |
TypeAliasDeclaration |
export type GetStreamFn = (
file: StoreFile,
start?: number | undefined,
end?: number | undefined,
) => Promise<{
stream: NodeJS.ReadableStream;
cacheControl: string;
}>; | compasjs/compas | packages/store/src/send-transformed-image.d.ts | TypeScript |
TypeAliasDeclaration |
export type Postgres = import("../types/advanced-types").Postgres; | compasjs/compas | packages/store/src/send-transformed-image.d.ts | TypeScript |
TypeAliasDeclaration |
export type MinioClient = import("../types/advanced-types").MinioClient; | compasjs/compas | packages/store/src/send-transformed-image.d.ts | TypeScript |
TypeAliasDeclaration |
export type Context = import("koa").Context; | compasjs/compas | packages/store/src/send-transformed-image.d.ts | TypeScript |
FunctionDeclaration |
export function Logo({ duration, children }: LogoAnimationProps) {
return (
<div>
{children}
</div>
)
} | FelixWieland/splashscreen | src/lib/components/Logo.tsx | TypeScript |
FunctionDeclaration |
function isNonEmptyString(value: any): value is string {
if (value) {
return true;
}
throw new TypeError(`<x-preview-image> property must be a non empty string`);
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
FunctionDeclaration |
function failIfNaN(value: any): value is number {
if (isNaN(value)) {
throw new TypeError(`<x-preview-image> property must be a number`);
}
return true;
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
ClassDeclaration |
@define(template)
export class XPreviewImage extends Component {
idx: number = -1;
mimeType: string;
@prop() filename: string;
@prop() base64: string;
@prop() width: number = 0;
@prop() height: number = 0;
@prop() page: number = 0;
@selector("#img") private $img: HTMLImageElement;
@selector("#text"... | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
MethodDeclaration |
@attr("filename")
@observer("filename")
filenameAttr(value?: string) {
if (isNonEmptyString(value)) {
this.filename = value;
this.setAttribute("filename", value);
this.$text.textContent = value;
}
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
MethodDeclaration |
@observer("base64")
base64Observer(value?: string) {
if (isNonEmptyString(value)) {
this.$img.src = value;
}
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
MethodDeclaration |
@observer("width")
widthObserver(value: number) {
if (failIfNaN(value)) {
this.$size.textContent = `${value} x ${this.height}`;
}
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
MethodDeclaration |
@observer("height")
heightObserver(value: number) {
if (failIfNaN(value)) {
this.$size.textContent = `${this.width} x ${value}`;
}
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
MethodDeclaration |
@observer("page")
pageObserver(value: number) {
if (failIfNaN(value)) {
this.$page.textContent = `- ${value} -`;
}
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
MethodDeclaration | /**
* DOM Events
*/
@on("dragover", ":host")
handleDragOver(event: DragEvent) {
event.preventDefault();
event.dataTransfer.dropEffect = "move";
this.classList.add("XPreviewImage--dragOver");
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
MethodDeclaration |
@on("dragleave", ":host")
handleDragLeave() {
this.classList.remove("XPreviewImage--dragOver");
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
MethodDeclaration |
@on("drop", ":host")
handleDrop(event: DragEvent) {
this.classList.remove("XPreviewImage--dragOver");
const dataPage = event.dataTransfer.getData("page");
if (typeof dataPage === "string") {
const source = Number.parseInt(dataPage, 10);
const target = this.page;
if (source !== target)... | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
MethodDeclaration |
@on("dragstart", ":host")
handleDragStart(event: DragEvent) {
this.classList.add("XPreviewImage--dragStart");
event.dataTransfer.setData("page", this.page.toString());
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
MethodDeclaration |
@on("dragend", ":host")
handleDragEnd() {
this.classList.remove("XPreviewImage--dragStart");
} | oriSomething/pack-pdf | src/ui/XPreviewImage.ts | TypeScript |
ArrowFunction |
r => r.buffer() | nickbclifford/physicsbot | src/commands/wolfram.ts | TypeScript |
MethodDeclaration |
async run(client, message, args) {
const query = encodeURIComponent(args.join(' '));
if (query.length === 0) {
await message.channel.send('Cannot make an empty query to Wolfram|Alpha.');
return;
}
const loadingMsg = await message.channel.send('Making request...') as Message;
let wolframImage: Buffer;... | nickbclifford/physicsbot | src/commands/wolfram.ts | TypeScript |
ArrowFunction |
({ row: { original } }) => {
const declarationType = original.declarationType;
const isYesDeclarationType = declarationType.toUpperCase() === 'YES';
return (
<>
{isYesDeclarationType ? (
<strong className="text-success">{declarationType}</strong>
) : (
... | asanchezr/PSP | frontend/src/features/leases/detail/LeasePages/surplus/Surplus.tsx | TypeScript |
ArrowFunction |
({ cell: { value } }) => prettyFormatDate(value) | asanchezr/PSP | frontend/src/features/leases/detail/LeasePages/surplus/Surplus.tsx | TypeScript |
ArrowFunction |
() => {
const { values } = useFormikContext<ILease>();
const properties: IProperty[] = getIn(values, 'properties') ?? [];
let declarations: IDeclaration[] = properties.map<IDeclaration>(x => {
return {
id: x.id || Math.random(),
identifier: x.pid,
comments: x.surplusDeclaration?.comment ||... | asanchezr/PSP | frontend/src/features/leases/detail/LeasePages/surplus/Surplus.tsx | TypeScript |
ArrowFunction |
x => {
return {
id: x.id || Math.random(),
identifier: x.pid,
comments: x.surplusDeclaration?.comment || '',
declarationType: x.surplusDeclaration?.type?.description || 'Unknown',
date: x.surplusDeclaration?.date || '',
};
} | asanchezr/PSP | frontend/src/features/leases/detail/LeasePages/surplus/Surplus.tsx | TypeScript |
InterfaceDeclaration |
interface IDeclaration {
id: number;
identifier: string;
declarationType: string;
date: string;
comments: string;
} | asanchezr/PSP | frontend/src/features/leases/detail/LeasePages/surplus/Surplus.tsx | TypeScript |
MethodDeclaration |
isYesDeclarationType ? (
<strong className="text-success">{declarationType}</strong>
) : (
<span>{declarationType} | asanchezr/PSP | frontend/src/features/leases/detail/LeasePages/surplus/Surplus.tsx | TypeScript |
ArrowFunction |
() => {
console.log('Server ready')
} | deepzS2/deepzBOT | src/server/index.ts | TypeScript |
ArrowFunction |
(err) => {
console.error(err)
} | deepzS2/deepzBOT | src/server/index.ts | TypeScript |
ArrowFunction |
() => {
console.log(`Server started! Listening to ${port}`)
} | deepzS2/deepzBOT | src/server/index.ts | TypeScript |
ClassDeclaration |
export default class WebDashboard {
readonly app: Express
readonly client: Client
/**
* Initialize the server
* @param client Client instance
*/
constructor() {
this.app = express()
this.client = new Client()
const PORT = process.env.PORT || 3000
this.start(PORT)
.then(() => {... | deepzS2/deepzBOT | src/server/index.ts | TypeScript |
MethodDeclaration | /**
* Starts the server!
* @param port Port to listen
*/
public async start(port: number | string): Promise<void> {
this.ejsConfigurations()
this.oAuthConfigurations()
// this.jsonConfigurations()
this.initRoutes()
await this.client.login(process.env.TOKEN)
this.app.listen(port, () =>... | deepzS2/deepzBOT | src/server/index.ts | TypeScript |
MethodDeclaration | /**
* EJS configs
*/
private ejsConfigurations() {
this.app.use(express.static(path.join(__dirname, 'assets')))
this.app.set('view engine', 'ejs')
this.app.use(ejsLayouts)
this.app.set('views', path.join(__dirname, 'views'))
} | deepzS2/deepzBOT | src/server/index.ts | TypeScript |
MethodDeclaration | /**
* Initialize routes
*/
private initRoutes() {
const routes = new Routes(this.client)
this.app.use(routes.getRoutes())
} | deepzS2/deepzBOT | src/server/index.ts | TypeScript |
MethodDeclaration | /**
* OAuth configs
*/
private oAuthConfigurations() {
this.app.use(passport.initialize())
this.app.use(
session({
secret: process.env.SECRET_API,
resave: false,
saveUninitialized: false,
})
)
} | deepzS2/deepzBOT | src/server/index.ts | TypeScript |
MethodDeclaration | /**
* JSON (optional)
*/
private jsonConfigurations() {
this.app.use(express.json())
this.app.use(express.urlencoded({ extended: true }))
} | deepzS2/deepzBOT | src/server/index.ts | TypeScript |
ClassDeclaration |
@EntityRepository(TelefoneDependente)
export class TelefoneDependenteRepository extends Repository<TelefoneDependente>{ } | hugo-dutra/api-corretora-web | src/modules/telefone-dependente/telefone-dependente.repository.ts | TypeScript |
FunctionDeclaration |
function getWebviewSource(
firebaseConfig: IFirebaseOptions,
firebaseVersion?: string,
appVerificationDisabledForTesting: boolean = false,
languageCode?: string,
invisible?: boolean
) {
firebaseVersion = firebaseVersion || '8.0.0';
return {
baseUrl: `https://${firebaseConfig.authDomain}`,
html: `... | edusig/expo | packages/expo-firebase-recaptcha/src/FirebaseRecaptcha.tsx | TypeScript |
FunctionDeclaration |
function validateFirebaseConfig(firebaseConfig?: IFirebaseOptions) {
if (!firebaseConfig) {
throw new CodedError(
'ERR_FIREBASE_RECAPTCHA_CONFIG',
`Missing firebase web configuration. Please set the "expo.web.config.firebase" field in "app.json" or use the "firebaseConfig" prop.`
);
}
const {... | edusig/expo | packages/expo-firebase-recaptcha/src/FirebaseRecaptcha.tsx | TypeScript |
FunctionDeclaration |
export default function FirebaseRecaptcha(props: Props) {
const {
firebaseConfig,
firebaseVersion,
appVerificationDisabledForTesting,
languageCode,
onVerify,
onLoad,
onError,
onFullChallenge,
invisible,
verify,
...otherProps
} = props;
const webview = React.useRef(null... | edusig/expo | packages/expo-firebase-recaptcha/src/FirebaseRecaptcha.tsx | TypeScript |
ArrowFunction |
() => {
if (webview.current && loaded && verify) {
// @ts-ignore: Object is possibly null
webview.current.injectJavaScript(`
(function(){
window.dispatchEvent(new MessageEvent('message', {data: { verify: true }}));
})();
true;
`);
}
return () => {};
} | edusig/expo | packages/expo-firebase-recaptcha/src/FirebaseRecaptcha.tsx | TypeScript |
InterfaceDeclaration |
interface Props extends React.ComponentProps<typeof WebView> {
firebaseConfig?: IFirebaseOptions;
firebaseVersion?: string;
appVerificationDisabledForTesting?: boolean;
languageCode?: string;
onLoad?: () => any;
onError?: () => any;
onVerify: (token: string) => any;
onFullChallenge?: () => any;
invis... | edusig/expo | packages/expo-firebase-recaptcha/src/FirebaseRecaptcha.tsx | TypeScript |
MethodDeclaration |
getWebviewSource(
firebaseConfig,
firebaseVersion,
appVerificationDisabledForTesting,
languageCode,
invisible
) | edusig/expo | packages/expo-firebase-recaptcha/src/FirebaseRecaptcha.tsx | TypeScript |
ArrowFunction |
(value: TransactionEvent['event_type']) => {
switch (value) {
case 'stx_asset':
return 'Stacks Token';
case 'smart_contract_log':
return 'Smart Contract';
case 'fungible_token_asset':
return 'Fungible Asset';
case 'non_fungible_token_asset':
return 'Non-fungible Asset';
}
} | HariniRajan397/explorer | src/components/token-transfer/utils.ts | TypeScript |
ArrowFunction |
(value: TransactionType) => {
switch (value) {
case 'token_transfer':
return 'STX transfer';
case 'coinbase':
return 'Coinbase';
case 'contract_call':
return 'Function call';
case 'smart_contract':
return 'Contract deploy';
case 'poison_microblock':
return 'Poison mi... | HariniRajan397/explorer | src/components/token-transfer/utils.ts | TypeScript |
ArrowFunction |
(value?: TransactionEventAssetType) => {
switch (value) {
case 'transfer':
return {
label: 'Transfer',
icon: TransferIcon,
bg: color('accent'),
};
case 'mint':
return {
label: 'Mint',
icon: MintIcon,
bg: color('feedback-success'),
};
... | HariniRajan397/explorer | src/components/token-transfer/utils.ts | TypeScript |
FunctionDeclaration |
function deployES(stack: Stack, domainName: string, cfnDomainProps?: elasticsearch.CfnDomainProps,
lambdaRoleARN?: string): [elasticsearch.CfnDomain, iam.Role] {
const userpool = defaults.buildUserPool(stack);
const userpoolclient = defaults.buildUserPoolClient(stack, userpool, {
userPoolClientName: 'test',
... | Conrad2134/aws-solutions-constructs | source/patterns/@aws-solutions-constructs/core/test/elasticsearch-helper.test.ts | TypeScript |
ArrowFunction |
() => {
const stack = new Stack();
deployES(stack, 'test-domain', {
snapshotOptions: {
automatedSnapshotStartHour: 5
}
});
expect(stack).toHaveResource('AWS::Elasticsearch::Domain', {
AccessPolicies: {
Statement: [
{
Action: "es:ESHttp*",
Effect: "Allow",
... | Conrad2134/aws-solutions-constructs | source/patterns/@aws-solutions-constructs/core/test/elasticsearch-helper.test.ts | TypeScript |
ArrowFunction |
() => {
const stack = new Stack();
deployES(stack, 'test-domain', {
elasticsearchVersion: '7.0'
});
expect(stack).toHaveResource('AWS::Elasticsearch::Domain', {
AccessPolicies: {
Statement: [
{
Action: "es:ESHttp*",
Effect: "Allow",
Principal: {
... | Conrad2134/aws-solutions-constructs | source/patterns/@aws-solutions-constructs/core/test/elasticsearch-helper.test.ts | TypeScript |
ArrowFunction |
() => {
const stack = new Stack();
deployES(stack, 'test-domain', {}, 'arn:aws:us-east-1:mylambdaRoleARN');
expect(stack).toHaveResource('AWS::Elasticsearch::Domain', {
AccessPolicies: {
Statement: [
{
Action: "es:ESHttp*",
Effect: "Allow",
Principal: {
... | Conrad2134/aws-solutions-constructs | source/patterns/@aws-solutions-constructs/core/test/elasticsearch-helper.test.ts | TypeScript |
ArrowFunction |
() => {
const stack = new Stack();
deployES(stack, 'test-domain');
const cwList = defaults.buildElasticSearchCWAlarms(stack);
expect(cwList.length).toEqual(9);
} | Conrad2134/aws-solutions-constructs | source/patterns/@aws-solutions-constructs/core/test/elasticsearch-helper.test.ts | TypeScript |
ArrowFunction |
() => {
return (<PrintFriendlyWrapper>
Hello
</PrintFriendlyWrapper>);
} | SudoDotDog/BWNL-Print-Friendly | stories/helper/wrapper.story.tsx | TypeScript |
ArrowFunction |
() => {
return (<button onClick={() | SudoDotDog/BWNL-Print-Friendly | stories/helper/wrapper.story.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.