type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
|---|---|---|---|---|
EnumDeclaration
|
/**
* A symbol kind.
*/
export enum SymbolKind {
File = 0,
Module = 1,
Namespace = 2,
Package = 3,
Class = 4,
Method = 5,
Property = 6,
Field = 7,
Constructor = 8,
Enum = 9,
Interface = 10,
Function = 11,
Variable = 12,
Constant = 13,
String = 14,
Number = 15,
Boolean = 16,
Array = 17,
Object = 18,
Key = 19,
Null = 20,
EnumMember = 21,
Struct = 22,
Event = 23,
Operator = 24,
TypeParameter = 25
}
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
EnumDeclaration
|
export enum CommentThreadCollapsibleState {
/**
* Determines an item is collapsed
*/
Collapsed = 0,
/**
* Determines an item is expanded
*/
Expanded = 1
}
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
TypeAliasDeclaration
|
/**
* @internal
*/
export type SuggestionType = 'method'
| 'function'
| 'constructor'
| 'field'
| 'variable'
| 'class'
| 'struct'
| 'interface'
| 'module'
| 'property'
| 'event'
| 'operator'
| 'unit'
| 'value'
| 'constant'
| 'enum'
| 'enum-member'
| 'keyword'
| 'snippet'
| 'text'
| 'color'
| 'file'
| 'reference'
| 'customcolor'
| 'folder'
| 'type-parameter';
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
TypeAliasDeclaration
|
/**
* @internal
*/
export type SnippetType = 'internal' | 'textmate';
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
TypeAliasDeclaration
|
/**
* The definition of a symbol represented as one or many [locations](#Location).
* For most programming languages there is only one location at which a symbol is
* defined.
*/
export type Definition = Location | Location[];
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
MethodDeclaration
|
public static getLanguageId(metadata: number): LanguageId {
return (metadata & MetadataConsts.LANGUAGEID_MASK) >>> MetadataConsts.LANGUAGEID_OFFSET;
}
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
MethodDeclaration
|
public static getTokenType(metadata: number): StandardTokenType {
return (metadata & MetadataConsts.TOKEN_TYPE_MASK) >>> MetadataConsts.TOKEN_TYPE_OFFSET;
}
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
MethodDeclaration
|
public static getFontStyle(metadata: number): FontStyle {
return (metadata & MetadataConsts.FONT_STYLE_MASK) >>> MetadataConsts.FONT_STYLE_OFFSET;
}
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
MethodDeclaration
|
public static getForeground(metadata: number): ColorId {
return (metadata & MetadataConsts.FOREGROUND_MASK) >>> MetadataConsts.FOREGROUND_OFFSET;
}
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
MethodDeclaration
|
public static getBackground(metadata: number): ColorId {
return (metadata & MetadataConsts.BACKGROUND_MASK) >>> MetadataConsts.BACKGROUND_OFFSET;
}
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
MethodDeclaration
|
public static getClassNameFromMetadata(metadata: number): string {
let foreground = this.getForeground(metadata);
let className = 'mtk' + foreground;
let fontStyle = this.getFontStyle(metadata);
if (fontStyle & FontStyle.Italic) {
className += ' mtki';
}
if (fontStyle & FontStyle.Bold) {
className += ' mtkb';
}
if (fontStyle & FontStyle.Underline) {
className += ' mtku';
}
return className;
}
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
MethodDeclaration
|
public static getInlineStyleFromMetadata(metadata: number, colorMap: string[]): string {
const foreground = this.getForeground(metadata);
const fontStyle = this.getFontStyle(metadata);
let result = `color: ${colorMap[foreground]};`;
if (fontStyle & FontStyle.Italic) {
result += 'font-style: italic;';
}
if (fontStyle & FontStyle.Bold) {
result += 'font-weight: bold;';
}
if (fontStyle & FontStyle.Underline) {
result += 'text-decoration: underline;';
}
return result;
}
|
Hawkbat/vscode
|
src/vs/editor/common/modes.ts
|
TypeScript
|
ArrowFunction
|
(domyślnie: 127.0.0.1)
|
diners-admin/Diners
|
src/qt/locale/bitcoin_pl.ts
|
TypeScript
|
ArrowFunction
|
(domyślnie: 100)
|
diners-admin/Diners
|
src/qt/locale/bitcoin_pl.ts
|
TypeScript
|
FunctionDeclaration
|
function Divide(props: IconProps) {
return (
<Svg
id="Raw"
viewBox="0 0 256 256"
width={props.size}
height={props.size}
fill={props.color}
{...props}
>
<Rect width={256} height={256} fill="none" />
<Line
x1={40}
y1={128}
x2={216}
y2={128}
stroke={props.color}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={16}
/>
<Circle cx={128} cy={64} r={16} fill={props.color} />
<Circle cx={128} cy={192} r={16} fill={props.color} />
</Svg>
);
}
|
kingdavidmartins/phosphor-react-native
|
src/duotone/Divide.tsx
|
TypeScript
|
InterfaceDeclaration
|
export interface IQuiz {
pk: number;
title: string;
media: IMedia | undefined;
questions: IQuestion[];
tags: ITag[];
slug: string;
answers: Map<number, string> | null;
score: Number | null;
}
|
Stephen00/dresscode-app
|
client-app/src/app/models/quiz.ts
|
TypeScript
|
ClassDeclaration
|
@Resolver()
export class NetworkResolver {
constructor(private readonly prisma: PrismaService) {}
@Query('networks')
async getNetworks(@Args() args, @Info() info?): Promise<Network[]> {
// console.log(JSON.stringify(args));
return await this.prisma.query.networks(args, info);
}
@Query('network')
async getNetwork(@Args() args, @Info() info): Promise<Network> {
return await this.prisma.query.network(args, info);
}
@Mutation('createNetwork')
async createNetwork(@Args() args, @Info() info): Promise<Network> {
return await this.prisma.mutation.createNetwork(args, info);
}
@Mutation('updateNetwork')
async updateNetwork(@Args() args, @Info() info): Promise<Network> {
return await this.prisma.mutation.updateNetwork(args, info);
}
}
|
datum-indo/cmslbh-backend
|
src/resolver/network.resolver.ts
|
TypeScript
|
MethodDeclaration
|
@Query('networks')
async getNetworks(@Args() args, @Info() info?): Promise<Network[]> {
// console.log(JSON.stringify(args));
return await this.prisma.query.networks(args, info);
}
|
datum-indo/cmslbh-backend
|
src/resolver/network.resolver.ts
|
TypeScript
|
MethodDeclaration
|
@Query('network')
async getNetwork(@Args() args, @Info() info): Promise<Network> {
return await this.prisma.query.network(args, info);
}
|
datum-indo/cmslbh-backend
|
src/resolver/network.resolver.ts
|
TypeScript
|
MethodDeclaration
|
@Mutation('createNetwork')
async createNetwork(@Args() args, @Info() info): Promise<Network> {
return await this.prisma.mutation.createNetwork(args, info);
}
|
datum-indo/cmslbh-backend
|
src/resolver/network.resolver.ts
|
TypeScript
|
MethodDeclaration
|
@Mutation('updateNetwork')
async updateNetwork(@Args() args, @Info() info): Promise<Network> {
return await this.prisma.mutation.updateNetwork(args, info);
}
|
datum-indo/cmslbh-backend
|
src/resolver/network.resolver.ts
|
TypeScript
|
ClassDeclaration
|
@Component({
selector: 'nested-grandson',
template: `<div>손자</div>`,
styles: [`div{border: 2px dotted #666;padding:10px;margin-top:5px;width:65%;height:65%;}`]
})
export class NestedGrandsonComponent{}
|
khjang4848/angular4study
|
Ng2BookStudy/Component/src/app/nested-component/grandson.component.ts
|
TypeScript
|
FunctionDeclaration
|
function useFileDialog() {
const [files, setFiles] = React.useState<FileList | null>(null);
const openFileDialog = () => {
const input = document.createElement('input');
input.type = 'file';
input.multiple = true;
input.addEventListener('change', (event: Event) => {
const { files } = event.target as HTMLInputElement;
setFiles(files);
});
input.click();
};
return { files, openFileDialog };
}
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
FunctionDeclaration
|
function useInsertFile() {
const { files, openFileDialog } = useFileDialog();
const { uploadFiles } = useCommands();
useEffect(() => {
if (files) {
const fileArray: File[] = [];
for (const file of files) {
fileArray.push(file);
}
uploadFiles(fileArray);
}
}, [files, uploadFiles]);
return { openFileDialog };
}
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): JSX.Element => {
const extensions = useCallback(() => [new FileExtension({})], []);
const { manager, state } = useRemirror({ extensions, content, stringHandler: 'html' });
return (
<>
<p>
Default Implementation. Uses <code>FileReader.readAsDataURL</code> under the hood.
</p>
<ThemeProvider>
<Remirror manager={manager} initialContent={state} autoRender>
<UploadFileButton />
<ProsemirrorDevTools />
</Remirror>
</ThemeProvider>
</>
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
() => [new FileExtension({})]
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): JSX.Element => {
const extensions = useCallback(
() => [new FileExtension({ uploadFileHandler: createObjectUrlFileUploader })],
[],
);
const { manager, state } = useRemirror({ extensions, content, stringHandler: 'html' });
return (
<>
<p>
Uses <code>URL.createObjectUrl</code> under the hood.
</p>
<ThemeProvider>
<Remirror manager={manager} initialContent={state} autoRender>
<UploadFileButton />
<ProsemirrorDevTools />
</Remirror>
</ThemeProvider>
</>
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
() => [new FileExtension({ uploadFileHandler: createObjectUrlFileUploader })]
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): JSX.Element => {
const extensions = useCallback(
() => [new FileExtension({ uploadFileHandler: createBaseuploadFileUploader })],
[],
);
const { manager, state } = useRemirror({ extensions, content, stringHandler: 'html' });
return (
<>
<p>
Actually upload the file to <a href='https://bashupload.com/'>https://bashupload.com/</a>.{' '}
bashupload is an open-source project created by IO-Technologies. Star it on{' '}
<a href='https://github.com/IO-Technologies/bashupload'>GitHub</a>.
</p>
<ThemeProvider>
<Remirror manager={manager} initialContent={state} autoRender>
<UploadFileButton />
<ProsemirrorDevTools />
</Remirror>
</ThemeProvider>
</>
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
() => [new FileExtension({ uploadFileHandler: createBaseuploadFileUploader })]
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): JSX.Element => {
const extensions = useCallback(
() => [new FileExtension({ uploadFileHandler: createSlowFileUploader })],
[],
);
const { manager, state } = useRemirror({ extensions, content, stringHandler: 'html' });
return (
<>
<p>
An example with slow uploading speed. You can see the upload progress and an abort button in
this example.
</p>
<ThemeProvider>
<Remirror manager={manager} initialContent={state} autoRender>
<UploadFileButton />
<ProsemirrorDevTools />
</Remirror>
</ThemeProvider>
</>
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
() => [new FileExtension({ uploadFileHandler: createSlowFileUploader })]
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const input = document.createElement('input');
input.type = 'file';
input.multiple = true;
input.addEventListener('change', (event: Event) => {
const { files } = event.target as HTMLInputElement;
setFiles(files);
});
input.click();
}
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
(event: Event) => {
const { files } = event.target as HTMLInputElement;
setFiles(files);
}
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
() => {
if (files) {
const fileArray: File[] = [];
for (const file of files) {
fileArray.push(file);
}
uploadFiles(fileArray);
}
}
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const { openFileDialog } = useInsertFile();
return <button onClick={openFileDialog}>Upload file</button>;
}
|
ctbarna/remirror
|
packages/remirror__extension-file/__stories__/file.stories.tsx
|
TypeScript
|
ArrowFunction
|
(props: EstimatedAPRItemProps) => {
const { labelClassName, valueClassName } = props
const { data: apr, isFetched } = useV4Apr()
const { t } = useTranslation()
return (
<InfoListItem
labelClassName={labelClassName}
valueClassName={valueClassName}
label={t('estimatedAverageApr', 'Estimated average APR')}
labelToolTip={t(
'estimatedAverageAprTooltip',
'Estimated average APR is a rough estimate based on the current TVL and daily prizes'
)}
loading={!isFetched}
|
pooltogether/tsunami-app
|
src/components/InfoList/EstimatedAPRItem.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface EstimatedAPRItemProps {
chainId: number
labelClassName?: string
valueClassName?: string
}
|
pooltogether/tsunami-app
|
src/components/InfoList/EstimatedAPRItem.tsx
|
TypeScript
|
MethodDeclaration
|
t('estimatedAverageApr', 'Estimated average APR')
|
pooltogether/tsunami-app
|
src/components/InfoList/EstimatedAPRItem.tsx
|
TypeScript
|
MethodDeclaration
|
t(
'estimatedAverageAprTooltip',
'Estimated average APR is a rough estimate based on the current TVL and daily prizes'
)
|
pooltogether/tsunami-app
|
src/components/InfoList/EstimatedAPRItem.tsx
|
TypeScript
|
ArrowFunction
|
async (node: ModuleDefinition): Promise<Module> => {
if (isForwardReference(node)) {
return await transform(node.forwardRef());
}
if (modulesMap.has(node)) {
return modulesMap.get(node)!;
}
const { name, ...metadata } = await Module.getMetadata(node);
const module = new Module(name, metadata, typeof node === 'function' ? node : undefined);
modulesMap.set(node, module);
const imports: Array<Module> = [];
for (const imported of metadata.imports) {
imports.push(await transform(imported));
}
module.imports = imports;
return module;
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
ArrowFunction
|
(module) => (module.container = this)
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
ArrowFunction
|
(g) => g.name === GLOBAL_MODULE_NAME
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
ArrowFunction
|
(memo, m) => new Map([...memo, ...m.providers])
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
ArrowFunction
|
async (token) => await this.resolve(token)
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
ArrowFunction
|
(token) => this.resolveSync(token)
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
ClassDeclaration
|
export class DiContainer {
public static async from<T>(
RootModule: Class<T>,
kwargs?: {
globalProviders: Array<Provider>;
},
): Promise<DiContainer> {
kwargs = { globalProviders: [], ...kwargs };
const modulesMap: Map<ModuleDefinition, Module> = new Map();
const transform = async (node: ModuleDefinition): Promise<Module> => {
if (isForwardReference(node)) {
return await transform(node.forwardRef());
}
if (modulesMap.has(node)) {
return modulesMap.get(node)!;
}
const { name, ...metadata } = await Module.getMetadata(node);
const module = new Module(name, metadata, typeof node === 'function' ? node : undefined);
modulesMap.set(node, module);
const imports: Array<Module> = [];
for (const imported of metadata.imports) {
imports.push(await transform(imported));
}
module.imports = imports;
return module;
};
await transform(RootModule);
const globalModuleMeta = { exports: [], imports: [], providers: kwargs.globalProviders };
const globalModule = new Module(GLOBAL_MODULE_NAME, globalModuleMeta);
const modules = [globalModule, ...modulesMap.values()];
const container = new DiContainer(modules);
await container._createInstances();
await container._callOnInit();
await container._callOnDidInit();
container._isInitialized = true;
return container;
}
private _isInitialized = false;
private constructor(private readonly _modules: Array<Module>) {
this._modules.forEach((module) => (module.container = this));
}
get globalModule(): Module {
return this._modules.find((g) => g.name === GLOBAL_MODULE_NAME)!;
}
get providers(): Map<Token<unknown>, ProviderWrapper<unknown>> {
return this._modules.reduce((memo, m) => new Map([...memo, ...m.providers]), new Map());
}
get isInitialized(): boolean {
return this._isInitialized;
}
public get<T = unknown, R = T>(token: Token<T>): R {
const provider = this.providers.get(token) as ProviderWrapper<R>;
if (provider == null) {
throw new UnknownElementError(token);
}
if (provider.isTransient) {
throw new InvalidScopeError(token);
}
return provider.getInstance(DEFAULT_INJECTION_CONTEXT);
}
public async resolve<T = unknown, R = T>(
token: Token<T>,
context: InjectionContext = DEFAULT_INJECTION_CONTEXT,
inquirer: any = { id: Math.random() },
): Promise<R> {
const provider = this.providers.get(token) as ProviderWrapper<R>;
if (provider == null) {
throw new UnknownElementError(token);
}
return await provider.resolveInstance(context, inquirer);
}
/**
* Used to resolve providers if they don't have any asynchronous dependencies.
*
* Asynchronous dependencies are transient factory providers.
*/
public resolveSync<T = unknown, R = T>(
token: Token<T>,
context: InjectionContext = DEFAULT_INJECTION_CONTEXT,
inquirer: any = { id: Math.random() },
): R {
const provider = this.providers.get(token) as ProviderWrapper<R>;
if (provider == null) {
throw new UnknownElementError(token);
}
return provider.resolveInstanceSync(context, inquirer);
}
public async resolveDependencies<T>(Class: Class<T>): Promise<T> {
const deps = Reflector.getConstructorDependencies(Class);
const resolvedDependencies = await Promise.all(
deps.map(async (token) => await this.resolve(token)),
);
return new Class(...resolvedDependencies);
}
public resolveDepsSync<T>(Class: Class<T>): T {
const deps = Reflector.getConstructorDependencies(Class);
const resolvedDependencies = deps.map((token) => this.resolveSync(token));
return new Class(...resolvedDependencies);
}
private async _createInstances(): Promise<void> {
for (const module of this._modules) {
await module.createInstances();
}
}
private async _callOnInit(): Promise<void> {
for (const module of this._modules) {
await module.callOnInit();
}
}
private async _callOnDidInit(): Promise<void> {
for (const module of this._modules) {
await module.callOnDidInit();
}
}
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
MethodDeclaration
|
public static async from<T>(
RootModule: Class<T>,
kwargs?: {
globalProviders: Array<Provider>;
},
): Promise<DiContainer> {
kwargs = { globalProviders: [], ...kwargs };
const modulesMap: Map<ModuleDefinition, Module> = new Map();
const transform = async (node: ModuleDefinition): Promise<Module> => {
if (isForwardReference(node)) {
return await transform(node.forwardRef());
}
if (modulesMap.has(node)) {
return modulesMap.get(node)!;
}
const { name, ...metadata } = await Module.getMetadata(node);
const module = new Module(name, metadata, typeof node === 'function' ? node : undefined);
modulesMap.set(node, module);
const imports: Array<Module> = [];
for (const imported of metadata.imports) {
imports.push(await transform(imported));
}
module.imports = imports;
return module;
};
await transform(RootModule);
const globalModuleMeta = { exports: [], imports: [], providers: kwargs.globalProviders };
const globalModule = new Module(GLOBAL_MODULE_NAME, globalModuleMeta);
const modules = [globalModule, ...modulesMap.values()];
const container = new DiContainer(modules);
await container._createInstances();
await container._callOnInit();
await container._callOnDidInit();
container._isInitialized = true;
return container;
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
MethodDeclaration
|
public get<T = unknown, R = T>(token: Token<T>): R {
const provider = this.providers.get(token) as ProviderWrapper<R>;
if (provider == null) {
throw new UnknownElementError(token);
}
if (provider.isTransient) {
throw new InvalidScopeError(token);
}
return provider.getInstance(DEFAULT_INJECTION_CONTEXT);
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
MethodDeclaration
|
public async resolve<T = unknown, R = T>(
token: Token<T>,
context: InjectionContext = DEFAULT_INJECTION_CONTEXT,
inquirer: any = { id: Math.random() },
): Promise<R> {
const provider = this.providers.get(token) as ProviderWrapper<R>;
if (provider == null) {
throw new UnknownElementError(token);
}
return await provider.resolveInstance(context, inquirer);
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Used to resolve providers if they don't have any asynchronous dependencies.
*
* Asynchronous dependencies are transient factory providers.
*/
public resolveSync<T = unknown, R = T>(
token: Token<T>,
context: InjectionContext = DEFAULT_INJECTION_CONTEXT,
inquirer: any = { id: Math.random() },
): R {
const provider = this.providers.get(token) as ProviderWrapper<R>;
if (provider == null) {
throw new UnknownElementError(token);
}
return provider.resolveInstanceSync(context, inquirer);
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
MethodDeclaration
|
public async resolveDependencies<T>(Class: Class<T>): Promise<T> {
const deps = Reflector.getConstructorDependencies(Class);
const resolvedDependencies = await Promise.all(
deps.map(async (token) => await this.resolve(token)),
);
return new Class(...resolvedDependencies);
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
MethodDeclaration
|
public resolveDepsSync<T>(Class: Class<T>): T {
const deps = Reflector.getConstructorDependencies(Class);
const resolvedDependencies = deps.map((token) => this.resolveSync(token));
return new Class(...resolvedDependencies);
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
MethodDeclaration
|
private async _createInstances(): Promise<void> {
for (const module of this._modules) {
await module.createInstances();
}
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
MethodDeclaration
|
private async _callOnInit(): Promise<void> {
for (const module of this._modules) {
await module.callOnInit();
}
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
MethodDeclaration
|
private async _callOnDidInit(): Promise<void> {
for (const module of this._modules) {
await module.callOnDidInit();
}
}
|
Bartmr/tokamakjs
|
packages/injection/src/di-container.ts
|
TypeScript
|
ArrowFunction
|
(
url: string,
scopes: string[],
documentUri: string,
textFieldValue: string,
cursorPosition: number,
projectId?: string
): CompletionItem[] => {
const ws = React.useRef<W3CWebSocket>();
const latestMessageId = React.useRef(0);
const latestDocumentVersion = React.useRef(0);
const [completionItems, setCompletionItems] = React.useState<CompletionItem[]>([]);
// Initialize websocket connection for a specific url
React.useEffect(() => {
ws.current = new W3CWebSocket(url);
ws.current.onopen = () => {
ws.current.send(JSON.stringify(getInitializeMessage(scopes, projectId)));
ws.current.send(
JSON.stringify(
getTextDocumentOpenedMessage(documentUri, LANGUAGE_NAME, latestDocumentVersion.current, textFieldValue)
)
);
};
ws.current.onmessage = (messageText) => {
handleMessage(messageText);
};
}, [url]);
// If scopes change, update backend with info
React.useEffect(() => {
if (ws.current && ws.current.readyState === WebSocket.OPEN) {
ws.current.send(JSON.stringify(getConfigurationChangedMessage(scopes, projectId)));
}
}, [scopes, projectId]);
// When textField value changes, update backend memory and get latest completion results
React.useEffect(() => {
if (ws.current && ws.current.readyState === WebSocket.OPEN) {
updateBackendMemory(textFieldValue);
}
}, [textFieldValue]);
// Get completion results when selection changes
React.useEffect(() => {
if (ws.current && ws.current.readyState === WebSocket.OPEN) {
getCompletionItems();
}
}, [cursorPosition]);
// Handles messages coming back from the LSP server
const handleMessage = (messageText: MessageEvent) => {
const message = JSON.parse(messageText.data);
const id = message.id;
// Only completion messages have an id
// In the future, if other types of messages use id, then we would have to keep a table of {id: typeOfMessage} to know how to handle each message based on their id
if (id) {
if (message.result?.items) {
setCompletionItems(message.result?.items);
} else {
setCompletionItems([]);
}
}
};
// Every time the textField value changes, we need to tell the backend about it
const updateBackendMemory = (newValue: string) => {
latestDocumentVersion.current += 1;
if (ws.current.readyState === WebSocket.OPEN) {
ws.current.send(JSON.stringify(getDocumentChangedMessage(newValue, documentUri, latestDocumentVersion.current)));
}
};
// Requests completion results
const getCompletionItems = () => {
latestMessageId.current += 1;
ws.current.send(
JSON.stringify(
getCompletionRequestMessage(latestMessageId.current, documentUri, {
line: 0,
character: cursorPosition,
})
)
);
};
return completionItems;
}
|
14squared/BotFramework-Composer
|
Composer/packages/extensions/intellisense/src/hooks/useLanguageServer.ts
|
TypeScript
|
ArrowFunction
|
() => {
ws.current = new W3CWebSocket(url);
ws.current.onopen = () => {
ws.current.send(JSON.stringify(getInitializeMessage(scopes, projectId)));
ws.current.send(
JSON.stringify(
getTextDocumentOpenedMessage(documentUri, LANGUAGE_NAME, latestDocumentVersion.current, textFieldValue)
)
);
};
ws.current.onmessage = (messageText) => {
handleMessage(messageText);
};
}
|
14squared/BotFramework-Composer
|
Composer/packages/extensions/intellisense/src/hooks/useLanguageServer.ts
|
TypeScript
|
ArrowFunction
|
() => {
ws.current.send(JSON.stringify(getInitializeMessage(scopes, projectId)));
ws.current.send(
JSON.stringify(
getTextDocumentOpenedMessage(documentUri, LANGUAGE_NAME, latestDocumentVersion.current, textFieldValue)
)
);
}
|
14squared/BotFramework-Composer
|
Composer/packages/extensions/intellisense/src/hooks/useLanguageServer.ts
|
TypeScript
|
ArrowFunction
|
(messageText) => {
handleMessage(messageText);
}
|
14squared/BotFramework-Composer
|
Composer/packages/extensions/intellisense/src/hooks/useLanguageServer.ts
|
TypeScript
|
ArrowFunction
|
() => {
if (ws.current && ws.current.readyState === WebSocket.OPEN) {
ws.current.send(JSON.stringify(getConfigurationChangedMessage(scopes, projectId)));
}
}
|
14squared/BotFramework-Composer
|
Composer/packages/extensions/intellisense/src/hooks/useLanguageServer.ts
|
TypeScript
|
ArrowFunction
|
() => {
if (ws.current && ws.current.readyState === WebSocket.OPEN) {
updateBackendMemory(textFieldValue);
}
}
|
14squared/BotFramework-Composer
|
Composer/packages/extensions/intellisense/src/hooks/useLanguageServer.ts
|
TypeScript
|
ArrowFunction
|
() => {
if (ws.current && ws.current.readyState === WebSocket.OPEN) {
getCompletionItems();
}
}
|
14squared/BotFramework-Composer
|
Composer/packages/extensions/intellisense/src/hooks/useLanguageServer.ts
|
TypeScript
|
ArrowFunction
|
(messageText: MessageEvent) => {
const message = JSON.parse(messageText.data);
const id = message.id;
// Only completion messages have an id
// In the future, if other types of messages use id, then we would have to keep a table of {id: typeOfMessage} to know how to handle each message based on their id
if (id) {
if (message.result?.items) {
setCompletionItems(message.result?.items);
} else {
setCompletionItems([]);
}
}
}
|
14squared/BotFramework-Composer
|
Composer/packages/extensions/intellisense/src/hooks/useLanguageServer.ts
|
TypeScript
|
ArrowFunction
|
(newValue: string) => {
latestDocumentVersion.current += 1;
if (ws.current.readyState === WebSocket.OPEN) {
ws.current.send(JSON.stringify(getDocumentChangedMessage(newValue, documentUri, latestDocumentVersion.current)));
}
}
|
14squared/BotFramework-Composer
|
Composer/packages/extensions/intellisense/src/hooks/useLanguageServer.ts
|
TypeScript
|
ArrowFunction
|
() => {
latestMessageId.current += 1;
ws.current.send(
JSON.stringify(
getCompletionRequestMessage(latestMessageId.current, documentUri, {
line: 0,
character: cursorPosition,
})
)
);
}
|
14squared/BotFramework-Composer
|
Composer/packages/extensions/intellisense/src/hooks/useLanguageServer.ts
|
TypeScript
|
ClassDeclaration
|
export class BasicExtrationRule extends ExtractionRule {
name = 'basic'
shouldExtract(str: string) {
if (str.length === 0)
return ExtractionScore.MustExclude
// ✅ has a space, and any meaning full letters
if (str.includes(' ') && str.match(/\w/))
return ExtractionScore.ShouldInclude
// ❌ camel case
if (str.match(/[a-z][A-Z]/))
return ExtractionScore.ShouldExclude
// ❌ all digits
if (str.match(/^[\d.]+$/))
return ExtractionScore.ShouldExclude
// ✅ all words
if (str.match(/^[A-Za-z0-9]+$/))
return ExtractionScore.ShouldInclude
// ✅ one char
if (str.length === 1 && !'/.-\\+$^'.includes(str))
return ExtractionScore.ShouldInclude
}
}
|
ananni13/i18n-ally
|
src/core/extraction/rules/basic.ts
|
TypeScript
|
MethodDeclaration
|
shouldExtract(str: string) {
if (str.length === 0)
return ExtractionScore.MustExclude
// ✅ has a space, and any meaning full letters
if (str.includes(' ') && str.match(/\w/))
return ExtractionScore.ShouldInclude
// ❌ camel case
if (str.match(/[a-z][A-Z]/))
return ExtractionScore.ShouldExclude
// ❌ all digits
if (str.match(/^[\d.]+$/))
return ExtractionScore.ShouldExclude
// ✅ all words
if (str.match(/^[A-Za-z0-9]+$/))
return ExtractionScore.ShouldInclude
// ✅ one char
if (str.length === 1 && !'/.-\\+$^'.includes(str))
return ExtractionScore.ShouldInclude
}
|
ananni13/i18n-ally
|
src/core/extraction/rules/basic.ts
|
TypeScript
|
ClassDeclaration
|
@NgModule({
imports: [
RouterModule.forChild(routes),
],
exports: [
RouterModule,
],
})
export class InfoCaracteristicaRoutingModule { }
|
planesticud/campus_cliente
|
src/app/pages/info_caracteristica/info_caracteristica-routing.module.ts
|
TypeScript
|
ClassDeclaration
|
/**
* ORM - the Object Relational Mapper.
*
* Use instances of this class to:
*
* - Register your {@link Model} classes using {@link ORM#register}
* - Get the empty state for the underlying database with {@link ORM#getEmptyState}
* - Start an immutable database session with {@link ORM#session}
* - Start a mutating database session with {@link ORM#mutableSession}
*
* Internally, this class handles generating a schema specification from models
* to the database.
*/
declare class ORM<
I extends IndexedModelClasses<any>,
ModelNames extends keyof I = keyof I
> {
/**
* Creates a new ORM instance.
*/
constructor(opts?: ORMOpts<I>);
/**
* Registers a {@link Model} class to the ORM.
*
* If the model has declared any ManyToMany fields, their
* through models will be generated and registered with
* this call, unless a custom through model has been specified.
*
* @param model - a {@link Model} class to register
*/
register(...model: ReadonlyArray<I[ModelNames]>): void;
/**
* Gets a {@link Model} class by its name from the registry.
*
* @param modelName - the name of the {@link Model} class to get
*
* @throws If {@link Model} class is not found.
*
* @return the {@link Model} class, if found
*/
get<K extends ModelNames>(modelName: K): I[K];
/**
* Returns the empty database state.
*
* @see {@link OrmState}
*
* @return empty state
*/
getEmptyState(): OrmState<I>;
/**
* Begins an immutable database session.
*
* @see {@link OrmState}
* @see {@link SessionType}
*
* @param state - the state the database manages
*
* @return a new {@link Session} instance
*/
session(state?: OrmState<I>): OrmSession<I>;
/**
* Begins an mutable database session.
*
* @see {@link OrmState}
* @see {@link SessionType}
*
* @param state - the state the database manages
*
* @return a new {@link Session} instance
*/
mutableSession(state: OrmState<I>): OrmSession<I>;
/**
* Acquire database reference.
*
* If no database exists, an instance is created using either default or supplied implementation of {@link DatabaseCreator}.
*
* @return A {@link Database} instance structured according to registered schema.
*/
getDatabase(): Database<I>;
}
|
Matt-Weiss/redux-orm
|
src/ORM.d.ts
|
TypeScript
|
InterfaceDeclaration
|
/**
* ORM instantiation opts.
*
* Enables customization of database creation.
*/
interface ORMOpts<MClassMap> {
stateSelector?: (state: any) => OrmState<MClassMap>;
createDatabase?: DatabaseCreator;
}
|
Matt-Weiss/redux-orm
|
src/ORM.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
/**
* A `{typeof Model[modelName]: typeof Model}` map defining:
*
* - database schema
* - {@link Session} bound Model classes
* - ORM branch state type
*/
type IndexedModelClasses<
T extends { [k in keyof T]: typeof AnyModel } = {},
K extends keyof T = Extract<keyof T, T[keyof T]["modelName"]>
> = { [k in K]: T[K] };
|
Matt-Weiss/redux-orm
|
src/ORM.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
/**
* A mapped type capable of inferring ORM branch state type based on schema {@link Model}s.
*/
type OrmState<MClassMap extends IndexedModelClasses<any>> = {
[K in keyof MClassMap]: TableState<MClassMap[K]>;
};
|
Matt-Weiss/redux-orm
|
src/ORM.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Registers a {@link Model} class to the ORM.
*
* If the model has declared any ManyToMany fields, their
* through models will be generated and registered with
* this call, unless a custom through model has been specified.
*
* @param model - a {@link Model} class to register
*/
register(...model: ReadonlyArray<I[ModelNames]>): void;
|
Matt-Weiss/redux-orm
|
src/ORM.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Gets a {@link Model} class by its name from the registry.
*
* @param modelName - the name of the {@link Model} class to get
*
* @throws If {@link Model} class is not found.
*
* @return the {@link Model} class, if found
*/
get<K extends ModelNames>(modelName: K): I[K];
|
Matt-Weiss/redux-orm
|
src/ORM.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Returns the empty database state.
*
* @see {@link OrmState}
*
* @return empty state
*/
getEmptyState(): OrmState<I>;
|
Matt-Weiss/redux-orm
|
src/ORM.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Begins an immutable database session.
*
* @see {@link OrmState}
* @see {@link SessionType}
*
* @param state - the state the database manages
*
* @return a new {@link Session} instance
*/
session(state?: OrmState<I>): OrmSession<I>;
|
Matt-Weiss/redux-orm
|
src/ORM.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Begins an mutable database session.
*
* @see {@link OrmState}
* @see {@link SessionType}
*
* @param state - the state the database manages
*
* @return a new {@link Session} instance
*/
mutableSession(state: OrmState<I>): OrmSession<I>;
|
Matt-Weiss/redux-orm
|
src/ORM.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Acquire database reference.
*
* If no database exists, an instance is created using either default or supplied implementation of {@link DatabaseCreator}.
*
* @return A {@link Database} instance structured according to registered schema.
*/
getDatabase(): Database<I>;
|
Matt-Weiss/redux-orm
|
src/ORM.d.ts
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
const intl = useIntl();
return (
<PageContainer>
<Card>
<Tabs defaultActiveKey="1">
<TabPane tab="Detail" key="1">
<InvoiceTable />
</TabPane>
<TabPane tab="Import" key="2">
<InvoiceManage />
</TabPane>
</Tabs>
</Card>
</PageContainer>
);
}
|
taksapongKNP/bill-ktc-sim
|
frontend/src/pages/Invoice.tsx
|
TypeScript
|
ArrowFunction
|
(
props: SignInMethodCustomizationPropsInterface
): ReactElement => {
const {
appId,
authenticators,
authenticationSequence,
isLoading,
setIsLoading,
onIDPCreateWizardTrigger,
onReset,
onUpdate,
readOnly,
refreshAuthenticators,
[ "data-testid" ]: testId
} = props;
const { t } = useTranslation();
const dispatch = useDispatch();
const config: ConfigReducerStateInterface = useSelector((state: AppState) => state.config);
const [ sequence, setSequence ] = useState<AuthenticationSequenceInterface>(authenticationSequence);
const [ updateTrigger, setUpdateTrigger ] = useState<boolean>(false);
const [ adaptiveScript, setAdaptiveScript ] = useState<string | string[]>(undefined);
const [ requestPathAuthenticators, setRequestPathAuthenticators ] = useState<any>(undefined);
const [ selectedRequestPathAuthenticators, setSelectedRequestPathAuthenticators ] = useState<any>(undefined);
const [ steps, setSteps ] = useState<number>(1);
const [ isDefaultScript, setIsDefaultScript ] = useState<boolean>(true);
const [ isButtonDisabled, setIsButtonDisabled ] = useState<boolean>(false);
const [ updatedSteps, setUpdatedSteps ] = useState<AuthenticationStepInterface[]>();
const eventPublisher: EventPublisher = EventPublisher.getInstance();
/**
* Toggles the update trigger.
*/
useEffect(() => {
if (!updateTrigger) {
return;
}
setUpdateTrigger(false);
}, [ updateTrigger ]);
/**
* Fetch data on component load
*/
useEffect(() => {
fetchRequestPathAuthenticators();
}, []);
/**
* Updates the steps when the authentication sequence updates.
*/
useEffect(() => {
if (!authenticationSequence || !authenticationSequence?.steps || !Array.isArray(authenticationSequence.steps)) {
return;
}
setSteps(authenticationSequence.steps.length);
}, [ authenticationSequence ]);
/**
* Updates the number of authentication steps.
*
* @param {boolean} add - Set to `true` to add and `false` to remove.
*/
const updateSteps = (add: boolean): void => {
setSteps(add ? steps + 1 : steps - 1);
};
/**
* Handles the data loading from a adaptive auth template when it is selected
* from the panel.
*
* @param {AdaptiveAuthTemplateInterface} template - Adaptive authentication templates.
*/
const handleLoadingDataFromTemplate = (template: AdaptiveAuthTemplateInterface): void => {
if (!template) {
return;
}
setIsDefaultScript(false);
let newSequence = { ...sequence };
if (template.code) {
newSequence = {
...newSequence,
requestPathAuthenticators: selectedRequestPathAuthenticators,
script: JSON.stringify(template.code)
};
}
if (template.defaultAuthenticators) {
const steps: AuthenticationStepInterface[] = [];
for (const [ key, value ] of Object.entries(template.defaultAuthenticators)) {
steps.push({
id: parseInt(key, 10),
options: value.local.map((authenticator) => {
return {
authenticator,
idp: "LOCAL"
};
})
});
}
newSequence = {
...newSequence,
attributeStepId: 1,
steps,
subjectStepId: 1
};
}
setSequence(newSequence);
};
/**
* Handles authentication sequence update.
*
* @param {AuthenticationSequenceInterface} sequence - New authentication sequence.
* @param {boolean} forceReset - Force reset to default configuration.
*/
const handleSequenceUpdate = (sequence: AuthenticationSequenceInterface, forceReset?: boolean): void => {
let requestBody;
if (forceReset) {
requestBody = {
authenticationSequence: {
...DefaultFlowConfigurationSequenceTemplate,
requestPathAuthenticators: selectedRequestPathAuthenticators,
script: ""
}
};
} else {
requestBody = {
authenticationSequence: {
...sequence,
requestPathAuthenticators: selectedRequestPathAuthenticators,
script: adaptiveScript
}
};
}
setIsLoading(true);
updateAuthenticationSequence(appId, requestBody)
.then(() => {
dispatch(addAlert({
description: t("console:develop.features.applications.notifications.updateAuthenticationFlow" +
".success.description"),
level: AlertLevels.SUCCESS,
message: t("console:develop.features.applications.notifications.updateAuthenticationFlow" +
".success.message")
}));
onUpdate(appId);
})
.catch((error) => {
const DISALLOWED_PROGRAMMING_CONSTRUCTS = "APP-60001";
if (error.response && error.response.data?.code === DISALLOWED_PROGRAMMING_CONSTRUCTS) {
dispatch(addAlert({
description: (
<p>
<Trans
i18nKey={
"console:develop.features.applications.notifications" +
".conditionalScriptLoopingError.description"
}>
Looping constructs such as <Code>for</Code>, <Code>while</Code> and,
<Code>forEach</Code> are not allowed in the conditional authentication
script.
</Trans>
</p>
),
level: AlertLevels.ERROR,
message: t("console:develop.features.applications.notifications" +
".conditionalScriptLoopingError.message")
}));
return;
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(state: AppState) => state.config
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
() => {
if (!updateTrigger) {
return;
}
setUpdateTrigger(false);
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
() => {
fetchRequestPathAuthenticators();
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
() => {
if (!authenticationSequence || !authenticationSequence?.steps || !Array.isArray(authenticationSequence.steps)) {
return;
}
setSteps(authenticationSequence.steps.length);
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(add: boolean): void => {
setSteps(add ? steps + 1 : steps - 1);
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(template: AdaptiveAuthTemplateInterface): void => {
if (!template) {
return;
}
setIsDefaultScript(false);
let newSequence = { ...sequence };
if (template.code) {
newSequence = {
...newSequence,
requestPathAuthenticators: selectedRequestPathAuthenticators,
script: JSON.stringify(template.code)
};
}
if (template.defaultAuthenticators) {
const steps: AuthenticationStepInterface[] = [];
for (const [ key, value ] of Object.entries(template.defaultAuthenticators)) {
steps.push({
id: parseInt(key, 10),
options: value.local.map((authenticator) => {
return {
authenticator,
idp: "LOCAL"
};
})
});
}
newSequence = {
...newSequence,
attributeStepId: 1,
steps,
subjectStepId: 1
};
}
setSequence(newSequence);
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(authenticator) => {
return {
authenticator,
idp: "LOCAL"
};
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(sequence: AuthenticationSequenceInterface, forceReset?: boolean): void => {
let requestBody;
if (forceReset) {
requestBody = {
authenticationSequence: {
...DefaultFlowConfigurationSequenceTemplate,
requestPathAuthenticators: selectedRequestPathAuthenticators,
script: ""
}
};
} else {
requestBody = {
authenticationSequence: {
...sequence,
requestPathAuthenticators: selectedRequestPathAuthenticators,
script: adaptiveScript
}
};
}
setIsLoading(true);
updateAuthenticationSequence(appId, requestBody)
.then(() => {
dispatch(addAlert({
description: t("console:develop.features.applications.notifications.updateAuthenticationFlow" +
".success.description"),
level: AlertLevels.SUCCESS,
message: t("console:develop.features.applications.notifications.updateAuthenticationFlow" +
".success.message")
}));
onUpdate(appId);
})
.catch((error) => {
const DISALLOWED_PROGRAMMING_CONSTRUCTS = "APP-60001";
if (error.response && error.response.data?.code === DISALLOWED_PROGRAMMING_CONSTRUCTS) {
dispatch(addAlert({
description: (
<p>
<Trans
i18nKey={
"console:develop.features.applications.notifications" +
".conditionalScriptLoopingError.description"
}>
Looping constructs such as <Code>for</Code>, <Code>while</Code> and,
<Code>forEach</Code> are not allowed in the conditional authentication
script.
</Trans>
</p>
),
level: AlertLevels.ERROR,
message: t("console:develop.features.applications.notifications" +
".conditionalScriptLoopingError.message")
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
() => {
dispatch(addAlert({
description: t("console:develop.features.applications.notifications.updateAuthenticationFlow" +
".success.description"),
level: AlertLevels.SUCCESS,
message: t("console:develop.features.applications.notifications.updateAuthenticationFlow" +
".success.message")
}));
onUpdate(appId);
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(error) => {
const DISALLOWED_PROGRAMMING_CONSTRUCTS = "APP-60001";
if (error.response && error.response.data?.code === DISALLOWED_PROGRAMMING_CONSTRUCTS) {
dispatch(addAlert({
description: (
<p>
<Trans
i18nKey={
"console:develop.features.applications.notifications" +
".conditionalScriptLoopingError.description"
}>
Looping constructs such as <Code>for</Code>, <Code>while</Code> and,
<Code>forEach</Code> are not allowed in the conditional authentication
script.
</Trans>
</p>
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
() => {
setIsLoading(false);
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(): void => {
getRequestPathAuthenticators()
.then((response) => {
setRequestPathAuthenticators(response);
})
.catch((error) => {
if (error.response && error.response.data && error.response.data.detail) {
dispatch(addAlert({
description: t("console:develop.features.applications.edit.sections.signOnMethod.sections." +
"requestPathAuthenticators.notifications.getRequestPathAuthenticators.error.description",
{ description: error.response.data.description }),
level: AlertLevels.ERROR,
message: t("console:develop.features.applications.edit.sections.signOnMethod.sections." +
"requestPathAuthenticators.notifications.getRequestPathAuthenticators.error.message")
}));
} else {
// Generic error message
dispatch(addAlert({
description: t("console:develop.features.applications.edit.sections.signOnMethod.sections." +
"requestPathAuthenticators.notifications.getRequestPathAuthenticators.genericError." +
"description"),
level: AlertLevels.ERROR,
message: t("console:develop.features.applications.edit.sections.signOnMethod.sections." +
"requestPathAuthenticators.notifications.getRequestPathAuthenticators.genericError.message")
}));
}
});
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(response) => {
setRequestPathAuthenticators(response);
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(error) => {
if (error.response && error.response.data && error.response.data.detail) {
dispatch(addAlert({
description: t("console:develop.features.applications.edit.sections.signOnMethod.sections." +
"requestPathAuthenticators.notifications.getRequestPathAuthenticators.error.description",
{ description: error.response.data.description }),
level: AlertLevels.ERROR,
message: t("console:develop.features.applications.edit.sections.signOnMethod.sections." +
"requestPathAuthenticators.notifications.getRequestPathAuthenticators.error.message")
}));
} else {
// Generic error message
dispatch(addAlert({
description: t("console:develop.features.applications.edit.sections.signOnMethod.sections." +
"requestPathAuthenticators.notifications.getRequestPathAuthenticators.genericError." +
"description"),
level: AlertLevels.ERROR,
message: t("console:develop.features.applications.edit.sections.signOnMethod.sections." +
"requestPathAuthenticators.notifications.getRequestPathAuthenticators.genericError.message")
}));
}
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(script: string | string[]): void => {
setAdaptiveScript(script);
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(): void => {
if (AdaptiveScriptUtils.isEmptyScript(adaptiveScript)) {
setAdaptiveScript(AdaptiveScriptUtils.generateScript(steps + 1).join("\n"));
setIsDefaultScript(true);
}
eventPublisher.compute(() => {
const eventPublisherProperties : {
"script-based": boolean,
"step-based": Array<Record<number, string>>
} = {
"script-based": !AdaptiveScriptUtils.isDefaultScript(adaptiveScript, steps),
"step-based": []
};
updatedSteps.forEach((updatedStep) => {
const step : Record<number, string> = {};
if (Array.isArray(updatedStep?.options) && updatedStep.options.length > 0) {
updatedStep.options.forEach((element,id) => {
step[id] = kebabCase(element?.authenticator);
});
eventPublisherProperties["step-based"].push(step);
}
});
eventPublisher.publish("application-sign-in-method-click-update-button", {
type: eventPublisherProperties
});
});
setUpdateTrigger(true);
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const eventPublisherProperties : {
"script-based": boolean,
"step-based": Array<Record<number, string>>
} = {
"script-based": !AdaptiveScriptUtils.isDefaultScript(adaptiveScript, steps),
"step-based": []
};
updatedSteps.forEach((updatedStep) => {
const step : Record<number, string> = {};
if (Array.isArray(updatedStep?.options) && updatedStep.options.length > 0) {
updatedStep.options.forEach((element,id) => {
step[id] = kebabCase(element?.authenticator);
});
eventPublisherProperties["step-based"].push(step);
}
});
eventPublisher.publish("application-sign-in-method-click-update-button", {
type: eventPublisherProperties
});
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(updatedStep) => {
const step : Record<number, string> = {};
if (Array.isArray(updatedStep?.options) && updatedStep.options.length > 0) {
updatedStep.options.forEach((element,id) => {
step[id] = kebabCase(element?.authenticator);
});
eventPublisherProperties["step-based"].push(step);
}
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
ArrowFunction
|
(element,id) => {
step[id] = kebabCase(element?.authenticator);
}
|
Anandi-K/identity-apps
|
apps/console/src/features/applications/components/settings/sign-on-methods/sign-in-method-customization.tsx
|
TypeScript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.