type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration | /**
* Validate an alias by checking if the alias has been set.
* If not, fallback to the default alias if a custom one is set by the user, but ignore the system_default alias.
*/
public validateTokenAlias(alias?: string): boolean | string {
// bail out if the alias is not set and the default is set to the ... | jexia/jexia-sdk-js | src/api/core/tokenManager.ts | TypeScript |
FunctionDeclaration |
export async function getTasks(
board: string,
column: string,
apikey: string,
subdomain: string
): Promise<Task[]> {
return new Promise((resolve, reject) => {
const instance = axios.create({
baseURL: `https://${subdomain}.kanbanize.com/index.php/api/kanbanize`,
timeout: 5000,
headers: ... | renanalmeida/action-kanbanize-get-all-tasks | src/kanbanizeAPI.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
const instance = axios.create({
baseURL: `https://${subdomain}.kanbanize.com/index.php/api/kanbanize`,
timeout: 5000,
headers: {apikey}
})
instance
.post('get_all_tasks/format/json', {
boardid: board,
column
})
.then((response: any)... | renanalmeida/action-kanbanize-get-all-tasks | src/kanbanizeAPI.ts | TypeScript |
ArrowFunction |
(response: any) => {
const tasks: Task[] = response.data
resolve(tasks)
} | renanalmeida/action-kanbanize-get-all-tasks | src/kanbanizeAPI.ts | TypeScript |
ArrowFunction |
(error: any) => {
reject(error)
} | renanalmeida/action-kanbanize-get-all-tasks | src/kanbanizeAPI.ts | TypeScript |
FunctionDeclaration |
export async function up(knex : Knex) {
return knex.schema.createTable('points', table => {
table.increments('id').primary();
table.string('image').notNullable();
table.string('name').notNullable();
table.string('email').notNullable();
table.string('whatsapp').notNullable();
table.decimal('la... | diegoAndrade777/NLW-01 | server/src/database/migrations/00_create_points.ts | TypeScript |
FunctionDeclaration |
export async function down(knex : Knex) {
return knex.schema.dropTable('points')
} | diegoAndrade777/NLW-01 | server/src/database/migrations/00_create_points.ts | TypeScript |
ArrowFunction |
table => {
table.increments('id').primary();
table.string('image').notNullable();
table.string('name').notNullable();
table.string('email').notNullable();
table.string('whatsapp').notNullable();
table.decimal('latitude').notNullable();
table.decimal('longitude').notNullable();
table.str... | diegoAndrade777/NLW-01 | server/src/database/migrations/00_create_points.ts | TypeScript |
FunctionDeclaration |
function makeItem(id, height): any {
return {
id: id,
getHeight: function () { return height; },
isExpanded: function () { return false; },
getAllTraits: () => []
};
} | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
FunctionDeclaration |
function makeItems(...args: any[]) {
var r = [];
for (var i = 0; i < args.length; i += 2) {
r.push(makeItem(args[i], args[i + 1]));
}
return r;
} | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
FunctionDeclaration |
function makeNavigator(...args: any[]): any {
var items = makeItems.apply(null, args);
var i = 0;
return {
next: function () {
return items[i++] || null;
}
};
} | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
rangeMap = new TestHeightMap();
rangeMap.onInsertItems(makeNavigator('a', 3, 'b', 30, 'c', 25, 'd', 2));
} | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
rangeMap.dispose();
rangeMap = null;
} | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
assert.equal(rangeMap.itemAt(0), 'a');
assert.equal(rangeMap.itemAt(2), 'a');
assert.equal(rangeMap.itemAt(3), 'b');
assert.equal(rangeMap.itemAt(32), 'b');
assert.equal(rangeMap.itemAt(33), 'c');
assert.equal(rangeMap.itemAt(40), 'c');
assert.equal(rangeMap.itemAt(57), 'c');
assert.equal(range... | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => rangeMap.itemAt(60) | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
var navigator = makeNavigator('x', 4, 'y', 20, 'z', 8);
rangeMap.onInsertItems(navigator);
assert.equal(rangeMap.itemAt(0), 'x');
assert.equal(rangeMap.itemAt(3), 'x');
assert.equal(rangeMap.itemAt(4), 'y');
assert.equal(rangeMap.itemAt(23), 'y');
assert.equal(rangeMap.itemAt(24), 'z');
assert... | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => rangeMap.itemAt(92) | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
var navigator = makeNavigator('x', 4, 'y', 20, 'z', 8);
rangeMap.onInsertItems(navigator, 'a');
assert.equal(rangeMap.itemAt(0), 'a');
assert.equal(rangeMap.itemAt(2), 'a');
assert.equal(rangeMap.itemAt(3), 'x');
assert.equal(rangeMap.itemAt(6), 'x');
assert.equal(rangeMap.itemAt(7), 'y');
ass... | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
var navigator = makeNavigator('x', 4, 'y', 20, 'z', 8);
rangeMap.onInsertItems(navigator, 'd');
assert.equal(rangeMap.itemAt(0), 'a');
assert.equal(rangeMap.itemAt(2), 'a');
assert.equal(rangeMap.itemAt(3), 'b');
assert.equal(rangeMap.itemAt(32), 'b');
assert.equal(rangeMap.itemAt(33), 'c');
a... | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
rangeMap.onRemoveItems(new ArrayIterator(['a', 'b']));
assert.equal(rangeMap.itemAt(0), 'c');
assert.equal(rangeMap.itemAt(24), 'c');
assert.equal(rangeMap.itemAt(25), 'd');
assert.equal(rangeMap.itemAt(26), 'd');
assert.throws(() => rangeMap.itemAt(27));
} | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => rangeMap.itemAt(27) | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
rangeMap.onRemoveItems(new ArrayIterator(['c']));
assert.equal(rangeMap.itemAt(0), 'a');
assert.equal(rangeMap.itemAt(2), 'a');
assert.equal(rangeMap.itemAt(3), 'b');
assert.equal(rangeMap.itemAt(32), 'b');
assert.equal(rangeMap.itemAt(33), 'd');
assert.equal(rangeMap.itemAt(34), 'd');
assert.... | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => rangeMap.itemAt(35) | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
rangeMap.onRemoveItems(new ArrayIterator(['c', 'd']));
assert.equal(rangeMap.itemAt(0), 'a');
assert.equal(rangeMap.itemAt(2), 'a');
assert.equal(rangeMap.itemAt(3), 'b');
assert.equal(rangeMap.itemAt(32), 'b');
assert.throws(() => rangeMap.itemAt(33));
} | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => rangeMap.itemAt(33) | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
var navigator = makeNavigator('a', 1, 'b', 1);
rangeMap.onRefreshItems(navigator);
assert.equal(rangeMap.itemAt(0), 'a');
assert.equal(rangeMap.itemAt(1), 'b');
assert.equal(rangeMap.itemAt(2), 'c');
assert.equal(rangeMap.itemAt(26), 'c');
assert.equal(rangeMap.itemAt(27), 'd');
assert.equal(r... | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => rangeMap.itemAt(29) | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
var navigator = makeNavigator('b', 40, 'c', 4);
rangeMap.onRefreshItems(navigator);
assert.equal(rangeMap.itemAt(0), 'a');
assert.equal(rangeMap.itemAt(2), 'a');
assert.equal(rangeMap.itemAt(3), 'b');
assert.equal(rangeMap.itemAt(42), 'b');
assert.equal(rangeMap.itemAt(43), 'c');
assert.equal(... | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => rangeMap.itemAt(49) | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
var navigator = makeNavigator('d', 22);
rangeMap.onRefreshItems(navigator);
assert.equal(rangeMap.itemAt(0), 'a');
assert.equal(rangeMap.itemAt(2), 'a');
assert.equal(rangeMap.itemAt(3), 'b');
assert.equal(rangeMap.itemAt(32), 'b');
assert.equal(rangeMap.itemAt(33), 'c');
assert.equal(rangeMap... | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => rangeMap.itemAt(80) | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ArrowFunction |
() => {
var i = 0;
var itemsInRange = ['a', 'b'];
rangeMap.withItemsInRange(2, 27, function (item) { assert.equal(item, itemsInRange[i++]); });
assert.equal(i, itemsInRange.length);
i = 0;
itemsInRange = ['a', 'b'];
rangeMap.withItemsInRange(0, 3, function (item) { assert.equal(item, itemsInRange[i++]);... | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ClassDeclaration |
class TestHeightMap extends HeightMap {
protected createViewItem(item: any): IViewItem {
return {
model: item,
top: 0,
height: item.getHeight()
};
}
} | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
MethodDeclaration |
protected createViewItem(item: any): IViewItem {
return {
model: item,
top: 0,
height: item.getHeight()
};
} | 284km/vscode | src/vs/base/parts/tree/test/browser/treeViewModel.test.ts | TypeScript |
ClassDeclaration | // @flow
export default class mathematic {
constructor() {}
static add(value: number, value2: number): number {
return value + value2;
}
} | HananKavitz/nodejsDemo | src/mathematic.ts | TypeScript |
MethodDeclaration |
static add(value: number, value2: number): number {
return value + value2;
} | HananKavitz/nodejsDemo | src/mathematic.ts | TypeScript |
ClassDeclaration |
export class CreateThingCommand extends $Command<
CreateThingCommandInput,
CreateThingCommandOutput,
IoTClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties
constructor(readonly input: CreateThingCommandInput) {
// Start section: command_constructor
supe... | blakeembrey/aws-sdk-js-v3 | clients/client-iot/commands/CreateThingCommand.ts | TypeScript |
TypeAliasDeclaration |
export type CreateThingCommandInput = CreateThingRequest; | blakeembrey/aws-sdk-js-v3 | clients/client-iot/commands/CreateThingCommand.ts | TypeScript |
TypeAliasDeclaration |
export type CreateThingCommandOutput = CreateThingResponse & __MetadataBearer; | blakeembrey/aws-sdk-js-v3 | clients/client-iot/commands/CreateThingCommand.ts | TypeScript |
MethodDeclaration |
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: IoTClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<CreateThingCommandInput, CreateThingCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.de... | blakeembrey/aws-sdk-js-v3 | clients/client-iot/commands/CreateThingCommand.ts | TypeScript |
MethodDeclaration |
private serialize(input: CreateThingCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1CreateThingCommand(input, context);
} | blakeembrey/aws-sdk-js-v3 | clients/client-iot/commands/CreateThingCommand.ts | TypeScript |
MethodDeclaration |
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateThingCommandOutput> {
return deserializeAws_restJson1CreateThingCommand(output, context);
} | blakeembrey/aws-sdk-js-v3 | clients/client-iot/commands/CreateThingCommand.ts | TypeScript |
ClassDeclaration |
export class OrgMemberProfileSettingsComponent extends AbstractRouteComponent<DummyUiState, OrgMemberProfileSettingsRoute, HomeRoute> {
protected doRender(): JSX.Element | false | null {
return (
<div>
OrgMemberProfileSettingsComponent
</div>
);
}
p... | pythian/skeletos | src/examples/example-react-application/shared/components/home/profile/settings/orgsettings/orgmember/orgmembersettings/OrgMemberProfileSettingsComponent.tsx | TypeScript |
MethodDeclaration |
protected doRender(): JSX.Element | false | null {
return (
<div>
OrgMemberProfileSettingsComponent
</div>
);
} | pythian/skeletos | src/examples/example-react-application/shared/components/home/profile/settings/orgsettings/orgmember/orgmembersettings/OrgMemberProfileSettingsComponent.tsx | TypeScript |
MethodDeclaration |
protected doRenderLoading(loading: LoadingState): JSX.Element | false | null {
return null;
} | pythian/skeletos | src/examples/example-react-application/shared/components/home/profile/settings/orgsettings/orgmember/orgmembersettings/OrgMemberProfileSettingsComponent.tsx | TypeScript |
ClassDeclaration |
@NgModule({
imports: [ BrowserModule,
FormsModule, //import the FormsModule before binding with [(ngModel)]
AppRoutingModule
],
declarations: [ AppComponent,
DashboardComponent,
HeroDetailComponent,
Heroe... | rafabaptista/newAngular-tuto | src/app/app.module.ts | TypeScript |
ArrowFunction |
(item: TResource, config: Resource, query?: string) => {
let url = config.name === 'istio' ? getIstioLink(item) : `/namespaces/${item.namespace}/${config.name}/${item.name}`;
return query ? url + '?' + query : url;
} | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
ArrowFunction |
(item: TResource) => {
let to = '/namespaces/' + item.namespace + '/istio';
const name = item.name;
const type = item['type'];
// Adapters and Templates need to pass subtype
if (type === 'adapter' || type === 'template') {
// Build a /adapters/<adapter_type_plural>/<adapter_name> or
// /temp... | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
ArrowFunction |
(
item: AppListItem | WorkloadListItem | ServiceListItem
) => {
const hasMissingSC = hasMissingSidecar(item);
const additionalDetails = (item as WorkloadListItem | ServiceListItem).additionalDetailSample;
const spacer = hasMissingSC && additionalDetails && additionalDetails.icon;
return (
<td role="gridc... | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
ArrowFunction |
(item: TResource, config: Resource, icon: string) => {
const key = 'link_definition_' + config.name + '_' + item.namespace + '_' + item.name;
let itemName = config.name.charAt(0).toUpperCase() + config.name.slice(1);
if (config.name === 'istio') {
itemName = IstioTypes[item['type']].name;
}
return (
... | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
ArrowFunction |
(item: TResource) => {
return (
<td role="gridcell" key={'VirtuaItem_Namespace_' + item.namespace + '_' + item.name}>
<Tooltip position={TooltipPosition.top} content={<>Namespace</>}>
<Badge className={'virtualitem_badge_definition'}>NS</Badge>
</Tooltip>
{item.namespace}
</td> | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
ArrowFunction |
(item: TResource, __: Resource, _: string, health?: Health) => {
return (
<td role="gridcell" key={'VirtuaItem_Health_' + item.namespace + '_' + item.name}>
{health && <HealthIndicator id={item.name} health={health} mode={DisplayMode.SMALL} />} | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
ArrowFunction |
(item: WorkloadListItem) => {
const appLabel = item.appLabel;
const versionLabel = item.versionLabel;
return (
<td role="gridcell" key={'VirtuaItem_LabelValidation_' + item.namespace + '_' + item.name}>
{appLabel || versionLabel ? (
<span>
{appLabel && (
<Tooltip content={... | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
ArrowFunction |
(item: WorkloadListItem) => {
return (
<td role="gridcell" key={'VirtuaItem_WorkloadType_' + item.namespace + '_' + item.name}>
{item.type}
</td> | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
ArrowFunction |
(item: IstioConfigItem) => {
const type = item.type;
const object = IstioTypes[type];
return (
<td role="gridcell" key={'VirtuaItem_IstioType_' + item.namespace + '_' + item.name}>
{type === 'adapter' || type === 'template' ? `${object.name}: ${item[type]![type]}` : object.name} | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
ArrowFunction |
(
item: ServiceListItem | IstioConfigItem,
config: Resource
) => {
const validation = item.validation;
const linkQuery: string = item['type'] ? 'list=yaml' : '';
return (
<td role="gridcell" key={'VirtuaItem_Conf_' + item.namespace + '_' + item.name}>
{validation ? (
<Link to={`${getLink(it... | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
MethodDeclaration |
getLink(item, config) | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
MethodDeclaration |
validation ? (
<Link to={`${getLink(item, config, linkQuery)}` | jadeyliu939/kiali-ui | src/components/VirtualList/Renderers.tsx | TypeScript |
ClassDeclaration | /**
* <p>Lists IAM policy assignments in the current Amazon QuickSight account.</p>
*/
export class ListIAMPolicyAssignmentsCommand extends $Command<
ListIAMPolicyAssignmentsCommandInput,
ListIAMPolicyAssignmentsCommandOutput,
QuickSightClientResolvedConfig
> {
// Start section: command_properties
// End se... | PaulThompson/aws-sdk-js-v3 | clients/client-quicksight/commands/ListIAMPolicyAssignmentsCommand.ts | TypeScript |
TypeAliasDeclaration |
export type ListIAMPolicyAssignmentsCommandInput = ListIAMPolicyAssignmentsRequest; | PaulThompson/aws-sdk-js-v3 | clients/client-quicksight/commands/ListIAMPolicyAssignmentsCommand.ts | TypeScript |
TypeAliasDeclaration |
export type ListIAMPolicyAssignmentsCommandOutput = ListIAMPolicyAssignmentsResponse & __MetadataBearer; | PaulThompson/aws-sdk-js-v3 | clients/client-quicksight/commands/ListIAMPolicyAssignmentsCommand.ts | TypeScript |
MethodDeclaration | /**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: QuickSightClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListIAMPolicyAssignmentsCommandInput, ListIAMPolicyAssignmentsCommandOutput> {
this.middlewareStack.... | PaulThompson/aws-sdk-js-v3 | clients/client-quicksight/commands/ListIAMPolicyAssignmentsCommand.ts | TypeScript |
MethodDeclaration |
private serialize(input: ListIAMPolicyAssignmentsCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1ListIAMPolicyAssignmentsCommand(input, context);
} | PaulThompson/aws-sdk-js-v3 | clients/client-quicksight/commands/ListIAMPolicyAssignmentsCommand.ts | TypeScript |
MethodDeclaration |
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListIAMPolicyAssignmentsCommandOutput> {
return deserializeAws_restJson1ListIAMPolicyAssignmentsCommand(output, context);
} | PaulThompson/aws-sdk-js-v3 | clients/client-quicksight/commands/ListIAMPolicyAssignmentsCommand.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [
RouterModule.forRoot(
routes, {
useHash: environment.useHash,
// NOTICE: If you use `reuse-tab` component and turn on keepingScroll you can set to `disabled`
// Pls refer to https://ng-alain.com/components/reuse-tab
scrollPositionRestoration: 'top',
... | alikewater/ng-alain | src/app/routes/routes-routing.module.ts | TypeScript |
InterfaceDeclaration | /**
* The result of user doing warn, message or fail, built this way for
* expansion later.
*/
export interface Violation {
/** The string representation */
message: string;
/** Optional path to the file */
file?: string;
/** Optional line in the file */
line?: number;
/** Optional icon f... | RettyInc/danger-js | distribution/dsl/Violation.d.ts | TypeScript |
FunctionDeclaration |
async function importFsModule(): Promise<typeof import('./fs') | undefined> {
try {
return await import('./fs')
}
catch {
try {
// cjs environments
return require('./fs.cjs')
}
catch {
return undefined
}
}
} | QiroNT/unocss | packages/preset-icons/src/index.ts | TypeScript |
FunctionDeclaration |
async function searchForIcon(
collection: string,
id: string,
collections: Required<IconsOptions>['collections'],
scale: number,
) {
if (!collection || !id)
return
let iconSet = collections[collection]
if (typeof iconSet === 'function')
iconSet = await iconSet()
if (!iconSet && isNode && !isVSC... | QiroNT/unocss | packages/preset-icons/src/index.ts | TypeScript |
ArrowFunction |
i => i?.loadCollectionFromFS | QiroNT/unocss | packages/preset-icons/src/index.ts | TypeScript |
ArrowFunction |
i => `${i[0]}="${i[1]}"` | QiroNT/unocss | packages/preset-icons/src/index.ts | TypeScript |
ArrowFunction |
(options: IconsOptions = {}): Preset => {
const {
scale = 1,
mode = 'auto',
prefix = 'i-',
warn = false,
collections = {},
extraProperties = {},
layer = 'icons',
} = options
return {
name: '@unocss/preset-icons',
enforce: 'pre',
options,
layers: {
icons: -10,
... | QiroNT/unocss | packages/preset-icons/src/index.ts | TypeScript |
ArrowFunction |
async([full, body, _mode]) => {
let collection = ''
let name = ''
let svg: string | undefined
if (body.includes(':')) {
[collection, name] = body.split(':')
svg = await searchForIcon(collection, name, collections, scale)
}
else {
const part... | QiroNT/unocss | packages/preset-icons/src/index.ts | TypeScript |
InterfaceDeclaration |
interface Context {
render: (tpl: string, data?: any) => Promise<any>;
} | AaronBank/daruk | example/02-comments/typings/context.d.ts | TypeScript |
ClassDeclaration |
@Table
export class User extends Model<User> {
@Column
name: string;
@Column
email:string;
@Column
password:string;
} | Nanif/NodeJsCourse | src/DB/entities/user.entity.ts | TypeScript |
FunctionDeclaration |
export async function manipulate(
uri: string,
actions: ImageManipulationActions[] = [],
saveOptions: SaveOptions = {}
): Promise<ImageResult> {
// Remove in SDK 32+
console.warn(`ImageManipulator.manipulate is deprecated in favor of manipulateAsync, which has the same API except for the method name`);
ret... | ELDJAZAERY/expo | packages/expo/src/ImageManipulator.ts | TypeScript |
FunctionDeclaration |
export async function manipulateAsync(
uri: string,
actions: ImageManipulationActions[] = [],
saveOptions: SaveOptions = {}
): Promise<ImageResult> {
if (!(typeof uri === 'string')) {
throw new TypeError(`The "uri" argument must be a string`);
}
return ExponentImageManipulator.manipulate(uri, actions, ... | ELDJAZAERY/expo | packages/expo/src/ImageManipulator.ts | TypeScript |
TypeAliasDeclaration |
type ImageResult = {
uri: string,
width: number,
height: number,
base64?: string,
}; | ELDJAZAERY/expo | packages/expo/src/ImageManipulator.ts | TypeScript |
TypeAliasDeclaration |
type CropParameters = {
originX: number,
originY: number,
width: number,
height: number,
}; | ELDJAZAERY/expo | packages/expo/src/ImageManipulator.ts | TypeScript |
TypeAliasDeclaration |
type ImageManipulationActions = {
resize?: { width?: number, height?: number },
rotate?: number,
flip?: { vertical?: boolean, horizontal?: boolean },
crop?: CropParameters,
}; | ELDJAZAERY/expo | packages/expo/src/ImageManipulator.ts | TypeScript |
TypeAliasDeclaration |
type SaveOptions = {
base64?: boolean,
compress?: number,
format?: 'jpeg' | 'png',
}; | ELDJAZAERY/expo | packages/expo/src/ImageManipulator.ts | TypeScript |
FunctionDeclaration |
export function csv(
input: string,
options?: {
columns?: boolean | string[];
delimiter?: string;
}
): Promise<any | undefined> {
return new Promise((resolve, reject) => {
const cb: csvParse.Callback = (err, output) => {
if (err !== undefined) {
reject(err);
} else {
res... | paulshen/natto-stdlib | src/csv.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
const cb: csvParse.Callback = (err, output) => {
if (err !== undefined) {
reject(err);
} else {
resolve(output);
}
};
csvParse(input, options, cb);
} | paulshen/natto-stdlib | src/csv.ts | TypeScript |
ArrowFunction |
(err, output) => {
if (err !== undefined) {
reject(err);
} else {
resolve(output);
}
} | paulshen/natto-stdlib | src/csv.ts | TypeScript |
FunctionDeclaration |
function editTextMarker(marker: any) {
const value = prompt("enter label", marker.value);
if (value) {
marker.value = value;
let existingIcon: any = marker._icon;
if (!existingIcon) {
marker.setIcon(createLabelIcon(textIconClassName, value));
} else {
existingIcon.innerHTML = value;
}
} else {
co... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
ArrowFunction |
(layer: L.Layer) => {
const manager: ShapeManagerInterface | null = ShapeManagerRepository.getManagerByShapeDefLayer(layer);
if (manager) {
const shape: ShapeObject = <ShapeObject>manager.getShapeObjectFromDrawingLayer(layer);
const wkt: string = manager.shapeObjectToWkt(shape);
const id: number = ... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
ArrowFunction |
(layer: L.Layer) => {
const manager: ShapeManagerInterface | null = ShapeManagerRepository.getManagerByShapeDefLayer(layer);
if (manager && manager.getType() === ShapeType.POLYGON) {
const shape: PolygonShape = <any>manager.getShapeObjectFromDrawingLayer(layer);
polygonList.push(shape);
}
} | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
ArrowFunction |
(item: WktShape) => {
const shapeDef: ShapeDefinition = {
shapeWkt: item.wkt,
data: {
name: 'Editable layer', // TBD get isSelected from extended data
isSelected: false // TBD get isSelected from extended data
}
};
const manager: ShapeManagerInterface | null = ShapeManagerRepository.get... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
ArrowFunction |
() => {
editTextMarker(drawEvent.layer);
} | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
ArrowFunction |
(layer: L.Layer) => {
// Create shapeDef object for this layer
const { shapeObject, shapeWkt } = this.createShapeDefFromDrawLayer(layer, layer.shapeDef.shapeObject.type);
// Update just shapeObject, and shapeWkt
_.merge(layer.shapeDef, { shapeObject, shapeWkt });
// Create WktShape from layer
const ... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
ArrowFunction |
(layer: L.Layer) => {
const wkt: WktShape = this.createWktFromEditableLayer(layer);
if (wkt) {
wktList.push(wkt);
}
} | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
ArrowFunction |
(labelClass: string, labelText: string) => (
L.divIcon({
className: labelClass,
html: labelText
})
) | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
TypeAliasDeclaration |
export type DrawBarOptions_Dev = DrawBarOptions & {
draw?: DrawBarOptionsDraw_Dev,
edit?: DrawBarOptionsEdit_Dev
}; | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
TypeAliasDeclaration |
type DrawBarOptionsDraw_Dev = DrawBarOptionsDraw & {
circle?: any,
} | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
TypeAliasDeclaration |
type DrawBarOptionsEdit_Dev = DrawBarOptionsEdit & {
featureGroup: L.FeatureGroup
}; | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
MethodDeclaration |
init() {
const { drawBar } = this.context.props;
if (drawBar && drawBar.enable) {
this.createElement(drawBar);
// Add layer-line to layer manager
this.context.layersController.addingDrawableLayerToLayerController(this.drawableLayer);
if (this.element && this.drawableLayer) {
this.context.map.on(... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
MethodDeclaration |
public getDrawLayer(): L.FeatureGroup {
return this.drawableLayer;
} | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
MethodDeclaration |
public export(): WktShape[] {
const exportDrawableLayers: Array<WktShape> = [];
const layers = this.drawableLayer.getLayers();
layers.forEach((layer: L.Layer) => {
const manager: ShapeManagerInterface | null = ShapeManagerRepository.getManagerByShapeDefLayer(layer);
if (manager) {
const shape: ShapeOb... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
MethodDeclaration |
public clear() {
this.drawableLayer.clearLayers();
} | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
MethodDeclaration |
public getMultiPolygon() {
const layers = this.drawableLayer.getLayers();
const polygonList: PolygonShape[] = [];
layers.forEach((layer: L.Layer) => {
const manager: ShapeManagerInterface | null = ShapeManagerRepository.getManagerByShapeDefLayer(layer);
if (manager && manager.getType() === ShapeType.POLY... | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
MethodDeclaration | // TBD
public toggleUnits(): void {
console.log('TOOL BAR: toggleUnits() is TBD');
} | iofirag/stenciljs-gis-example | .history/src/components/gis-viewer/classes/features/DrawBarComp/DrawBarComp_20171229100019.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.