Skip to content

Commit

Permalink
typings fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberCookie committed Aug 28, 2024
1 parent 7c31597 commit 1ee6db5
Show file tree
Hide file tree
Showing 7 changed files with 352 additions and 397 deletions.
2 changes: 1 addition & 1 deletion client_core/ui/Slider/helpers/get_visual_elements.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//TODO?: visible slides count (???)
//TODO: number of visible slides at the moment (now is 1)

import React from 'react'

Expand Down
1 change: 1 addition & 0 deletions client_core/ui/with_defaults.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'

import extractProps from './_internals/props_extract'

import type { CoreUIComponent, CoreUIComponentWithDefaults } from './_internals/types'


Expand Down
2 changes: 1 addition & 1 deletion common/is/nullable/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Is nullable

Check if value is not null or undefned<br />
Check if value is null or undefned<br />

Receives **1** parameter: **Any**. Value to check<br />
Returns **Boolean**. **true** if value is **undefined** or **null**
Expand Down
2 changes: 1 addition & 1 deletion common/is/nullable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import isExists from '../exists'


/**
* Check if value is not null or undefned
* Check if value is null or undefned
*
* @param val Value to check
* @returns true if value is undefined or null
Expand Down
24 changes: 14 additions & 10 deletions core/client_build/plugins/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type DeepExclude<O1, O2> =
type AnyPlugin = abstract new (...args: any) => any
type AnyPluginInstance = Exclude<PluginConfigInstance<any, any>, boolean>
type AnyPluginInstances = Record<string, AnyPluginInstance>
type AllCaseUserPluginConfig = Exclude<UserPlugin<AnyPlugin, {}, {}, {}, {}>, boolean>
type AllCaseUserPluginConfig = UserPlugin<AnyPlugin, {}, {}, {}, {}>


type PluginConfigBase<_Plugin, _DefaultOptions> = {
Expand Down Expand Up @@ -103,17 +103,16 @@ type UserPlugin<
_DefaultInstances extends AnyPluginInstances | null = null,
_PluginOpts extends Obj = NonNullable<ConstructorParameters<_Plugin>[0]>
> = Partial<
PluginConfigBase<_Plugin, _DefaultOpts>
& (
PluginConfigOptions<_PluginOpts, _DefaultOpts, _Options>
|
PluginConfigInstances<_PluginOpts, _DefaultInstances>
)
> | boolean
PluginConfigBase<_Plugin, _DefaultOpts>
& (
PluginConfigOptions<_PluginOpts, _DefaultOpts, _Options>
|
PluginConfigInstances<_PluginOpts, _DefaultInstances>
)
> | boolean


//TODO typing: user plugin options
//TODO typing: required custom plugin and never predefined
type Plugins = {
compression?: UserPlugin<CompressionPlugin, null, null, DefaultPlugins['compression']['instances']>

Expand All @@ -135,7 +134,12 @@ type Plugins = {

eslint?: UserPlugin<EslintPlugin, DefaultEslintPluginOptions>

} & Obj<AllCaseUserPluginConfig>
} & Obj<
MakeRequiredFields<
Exclude<AllCaseUserPluginConfig, boolean>,
'plugin'
> | boolean
>



Expand Down
Loading

0 comments on commit 1ee6db5

Please sign in to comment.